ZERO_NULL, /* doing_getsock */
ZERO_NULL, /* perform_getsock */
rtmp_disconnect, /* disconnect */
+ ZERO_NULL, /* readwrite */
PORT_RTMP, /* defport */
CURLPROTO_RTMP, /* protocol */
PROTOPT_NONE /* flags*/
ZERO_NULL, /* doing_getsock */
ZERO_NULL, /* perform_getsock */
rtmp_disconnect, /* disconnect */
+ ZERO_NULL, /* readwrite */
PORT_RTMPT, /* defport */
CURLPROTO_RTMPT, /* protocol */
PROTOPT_NONE /* flags*/
ZERO_NULL, /* doing_getsock */
ZERO_NULL, /* perform_getsock */
rtmp_disconnect, /* disconnect */
+ ZERO_NULL, /* readwrite */
PORT_RTMP, /* defport */
CURLPROTO_RTMPE, /* protocol */
PROTOPT_NONE /* flags*/
ZERO_NULL, /* doing_getsock */
ZERO_NULL, /* perform_getsock */
rtmp_disconnect, /* disconnect */
+ ZERO_NULL, /* readwrite */
PORT_RTMPT, /* defport */
CURLPROTO_RTMPTE, /* protocol */
PROTOPT_NONE /* flags*/
ZERO_NULL, /* doing_getsock */
ZERO_NULL, /* perform_getsock */
rtmp_disconnect, /* disconnect */
+ ZERO_NULL, /* readwrite */
PORT_RTMPS, /* defport */
CURLPROTO_RTMPS, /* protocol */
PROTOPT_NONE /* flags*/
};
+
const struct Curl_handler Curl_handler_rtmpts = {
"RTMPTS", /* scheme */
rtmp_setup, /* setup_connection */
ZERO_NULL, /* doing_getsock */
ZERO_NULL, /* perform_getsock */
rtmp_disconnect, /* disconnect */
+ ZERO_NULL, /* readwrite */
PORT_RTMPS, /* defport */
CURLPROTO_RTMPTS, /* protocol */
PROTOPT_NONE /* flags*/
ZERO_NULL, /* doing_getsock */
ZERO_NULL, /* perform_getsock */
ZERO_NULL, /* disconnect */
+ ZERO_NULL, /* readwrite */
PORT_DICT, /* defport */
CURLPROTO_DICT, /* protocol */
PROTOPT_NONE /* flags */
ZERO_NULL, /* doing_getsock */
ZERO_NULL, /* perform_getsock */
ZERO_NULL, /* disconnect */
+ ZERO_NULL, /* readwrite */
0, /* defport */
CURLPROTO_FILE, /* protocol */
PROTOPT_NONETWORK /* flags */
ftp_getsock, /* doing_getsock */
ZERO_NULL, /* perform_getsock */
ftp_disconnect, /* disconnect */
+ ZERO_NULL, /* readwrite */
PORT_FTP, /* defport */
CURLPROTO_FTP, /* protocol */
PROTOPT_DUAL | PROTOPT_CLOSEACTION /* flags */
ftp_getsock, /* doing_getsock */
ZERO_NULL, /* perform_getsock */
ftp_disconnect, /* disconnect */
+ ZERO_NULL, /* readwrite */
PORT_FTPS, /* defport */
CURLPROTO_FTP | CURLPROTO_FTPS, /* protocol */
PROTOPT_SSL | PROTOPT_DUAL | PROTOPT_CLOSEACTION /* flags */
ZERO_NULL, /* doing_getsock */
ZERO_NULL, /* perform_getsock */
ZERO_NULL, /* disconnect */
+ ZERO_NULL, /* readwrite */
PORT_FTP, /* defport */
CURLPROTO_HTTP, /* protocol */
PROTOPT_NONE /* flags */
ZERO_NULL, /* doing_getsock */
ZERO_NULL, /* perform_getsock */
ZERO_NULL, /* disconnect */
+ ZERO_NULL, /* readwrite */
PORT_FTPS, /* defport */
CURLPROTO_HTTP, /* protocol */
PROTOPT_NONE /* flags */
ZERO_NULL, /* doing_getsock */
ZERO_NULL, /* perform_getsock */
ZERO_NULL, /* disconnect */
+ ZERO_NULL, /* readwrite */
PORT_GOPHER, /* defport */
CURLPROTO_GOPHER, /* protocol */
PROTOPT_NONE /* flags */
http_getsock_do, /* doing_getsock */
ZERO_NULL, /* perform_getsock */
ZERO_NULL, /* disconnect */
+ ZERO_NULL, /* readwrite */
PORT_HTTP, /* defport */
CURLPROTO_HTTP, /* protocol */
PROTOPT_NONE /* flags */
http_getsock_do, /* doing_getsock */
ZERO_NULL, /* perform_getsock */
ZERO_NULL, /* disconnect */
+ ZERO_NULL, /* readwrite */
PORT_HTTPS, /* defport */
CURLPROTO_HTTP | CURLPROTO_HTTPS, /* protocol */
PROTOPT_SSL /* flags */
imap_getsock, /* doing_getsock */
ZERO_NULL, /* perform_getsock */
imap_disconnect, /* disconnect */
+ ZERO_NULL, /* readwrite */
PORT_IMAP, /* defport */
CURLPROTO_IMAP, /* protocol */
PROTOPT_CLOSEACTION /* flags */
imap_getsock, /* doing_getsock */
ZERO_NULL, /* perform_getsock */
imap_disconnect, /* disconnect */
+ ZERO_NULL, /* readwrite */
PORT_IMAPS, /* defport */
CURLPROTO_IMAP | CURLPROTO_IMAPS, /* protocol */
PROTOPT_CLOSEACTION | PROTOPT_SSL /* flags */
ZERO_NULL, /* doing_getsock */
ZERO_NULL, /* perform_getsock */
ZERO_NULL, /* disconnect */
+ ZERO_NULL, /* readwrite */
PORT_IMAP, /* defport */
CURLPROTO_HTTP, /* protocol */
PROTOPT_NONE /* flags */
ZERO_NULL, /* doing_getsock */
ZERO_NULL, /* perform_getsock */
ZERO_NULL, /* disconnect */
+ ZERO_NULL, /* readwrite */
PORT_IMAPS, /* defport */
CURLPROTO_HTTP, /* protocol */
PROTOPT_NONE /* flags */
ZERO_NULL, /* doing_getsock */
ZERO_NULL, /* perform_getsock */
ldap_disconnect, /* disconnect */
+ ZERO_NULL, /* readwrite */
PORT_LDAP, /* defport */
CURLPROTO_LDAP, /* protocol */
PROTOPT_NONE /* flags */
ZERO_NULL, /* doing_getsock */
ZERO_NULL, /* perform_getsock */
ldap_disconnect, /* disconnect */
+ ZERO_NULL, /* readwrite */
PORT_LDAPS, /* defport */
CURLPROTO_LDAP, /* protocol */
PROTOPT_SSL /* flags */
pop3_getsock, /* doing_getsock */
ZERO_NULL, /* perform_getsock */
pop3_disconnect, /* disconnect */
+ ZERO_NULL, /* readwrite */
PORT_POP3, /* defport */
CURLPROTO_POP3, /* protocol */
PROTOPT_CLOSEACTION /* flags */
pop3_getsock, /* doing_getsock */
ZERO_NULL, /* perform_getsock */
pop3_disconnect, /* disconnect */
+ ZERO_NULL, /* readwrite */
PORT_POP3S, /* defport */
CURLPROTO_POP3 | CURLPROTO_POP3S, /* protocol */
PROTOPT_CLOSEACTION | PROTOPT_SSL /* flags */
ZERO_NULL, /* doing_getsock */
ZERO_NULL, /* perform_getsock */
ZERO_NULL, /* disconnect */
+ ZERO_NULL, /* readwrite */
PORT_POP3, /* defport */
CURLPROTO_HTTP, /* protocol */
PROTOPT_NONE /* flags */
ZERO_NULL, /* doing_getsock */
ZERO_NULL, /* perform_getsock */
ZERO_NULL, /* disconnect */
+ ZERO_NULL, /* readwrite */
PORT_POP3S, /* defport */
CURLPROTO_HTTP, /* protocol */
PROTOPT_NONE /* flags */
curl_socket_t *socks,
int numsocks);
+/*
+ * Parse and write out any available RTP data.
+ *
+ * nread: amount of data left after k->str. will be modified if RTP
+ * data is parsed and k->str is moved up
+ * readmore: whether or not the RTP parser needs more data right away
+ */
+static CURLcode rtsp_rtp_readwrite(struct SessionHandle *data,
+ struct connectdata *conn,
+ ssize_t *nread,
+ bool *readmore);
+
+
/* this returns the socket to wait for in the DO and DOING state for the multi
interface and then we're always _sending_ a request and thus we wait for
the single socket to become writable only */
rtsp_getsock_do, /* doing_getsock */
ZERO_NULL, /* perform_getsock */
Curl_rtsp_disconnect, /* disconnect */
+ rtsp_rtp_readwrite, /* readwrite */
PORT_RTSP, /* defport */
CURLPROTO_RTSP, /* protocol */
PROTOPT_NONE /* flags */
return result;
}
-CURLcode Curl_rtsp_rtp_readwrite(struct SessionHandle *data,
- struct connectdata *conn,
- ssize_t *nread,
- bool *readmore) {
+
+static CURLcode rtsp_rtp_readwrite(struct SessionHandle *data,
+ struct connectdata *conn,
+ ssize_t *nread,
+ bool *readmore) {
struct SingleRequest *k = &data->req;
struct rtsp_conn *rtspc = &(conn->proto.rtspc);
extern const struct Curl_handler Curl_handler_rtsp;
-/*
- * Parse and write out any available RTP data.
- *
- * nread: amount of data left after k->str. will be modified if RTP
- * data is parsed and k->str is moved up
- * readmore: whether or not the RTP parser needs more data right away
- */
-CURLcode Curl_rtsp_rtp_readwrite(struct SessionHandle *data,
- struct connectdata *conn,
- ssize_t *nread,
- bool *readmore);
-
-
/* protocol-specific functions set up to be called by the main engine */
CURLcode Curl_rtsp(struct connectdata *conn, bool *done);
CURLcode Curl_rtsp_done(struct connectdata *conn, CURLcode, bool premature);
smtp_getsock, /* doing_getsock */
ZERO_NULL, /* perform_getsock */
smtp_disconnect, /* disconnect */
+ ZERO_NULL, /* readwrite */
PORT_SMTP, /* defport */
CURLPROTO_SMTP, /* protocol */
PROTOPT_CLOSEACTION /* flags */
smtp_getsock, /* doing_getsock */
ZERO_NULL, /* perform_getsock */
smtp_disconnect, /* disconnect */
+ ZERO_NULL, /* readwrite */
PORT_SMTPS, /* defport */
CURLPROTO_SMTP | CURLPROTO_SMTPS, /* protocol */
PROTOPT_CLOSEACTION | PROTOPT_SSL /* flags */
ZERO_NULL, /* doing_getsock */
ZERO_NULL, /* perform_getsock */
ZERO_NULL, /* disconnect */
+ ZERO_NULL, /* readwrite */
PORT_SMTP, /* defport */
CURLPROTO_HTTP, /* protocol */
PROTOPT_NONE /* flags */
ZERO_NULL, /* doing_getsock */
ZERO_NULL, /* perform_getsock */
ZERO_NULL, /* disconnect */
+ ZERO_NULL, /* readwrite */
PORT_SMTPS, /* defport */
CURLPROTO_HTTP, /* protocol */
PROTOPT_NONE /* flags */
ssh_getsock, /* doing_getsock */
ssh_perform_getsock, /* perform_getsock */
scp_disconnect, /* disconnect */
+ ZERO_NULL, /* readwrite */
PORT_SSH, /* defport */
CURLPROTO_SCP, /* protocol */
PROTOPT_DIRLOCK | PROTOPT_CLOSEACTION /* flags */
ssh_getsock, /* doing_getsock */
ssh_perform_getsock, /* perform_getsock */
sftp_disconnect, /* disconnect */
+ ZERO_NULL, /* readwrite */
PORT_SSH, /* defport */
CURLPROTO_SFTP, /* protocol */
PROTOPT_DIRLOCK | PROTOPT_CLOSEACTION /* flags */
ZERO_NULL, /* doing_getsock */
ZERO_NULL, /* perform_getsock */
ZERO_NULL, /* disconnect */
+ ZERO_NULL, /* readwrite */
PORT_TELNET, /* defport */
CURLPROTO_TELNET, /* protocol */
PROTOPT_NONE /* flags */
tftp_getsock, /* doing_getsock */
ZERO_NULL, /* perform_getsock */
tftp_disconnect, /* disconnect */
+ ZERO_NULL, /* readwrite */
PORT_TFTP, /* defport */
CURLPROTO_TFTP, /* protocol */
PROTOPT_NONE /* flags */
in the flow below before the actual storing is done. */
k->str = k->buf;
-#ifndef CURL_DISABLE_RTSP
- /* Check for RTP at the beginning of the data */
- if(conn->handler->protocol & CURLPROTO_RTSP) {
- result = Curl_rtsp_rtp_readwrite(data, conn, &nread, &readmore);
+ if(conn->handler->readwrite) {
+ result = conn->handler->readwrite(data, conn, &nread, &readmore);
if(result)
return result;
if(readmore)
break;
}
-#endif
#ifndef CURL_DISABLE_HTTP
/* Since this is a two-state thing, we check if we are parsing
if(result)
return result;
-#ifndef CURL_DISABLE_RTSP
- /* Check for RTP after the headers if there is no Content */
- if(k->maxdownload <= 0 && nread > 0 &&
- (conn->handler->protocol & CURLPROTO_RTSP)) {
- result = Curl_rtsp_rtp_readwrite(data, conn, &nread, &readmore);
+ if(conn->handler->readwrite &&
+ (k->maxdownload <= 0 && nread > 0)) {
+ result = conn->handler->readwrite(data, conn, &nread, &readmore);
if(result)
return result;
if(readmore)
break;
}
-#endif
if(stop_reading) {
/* We've stopped dealing with input, get out of the do-while loop */
} /* if(! header and data to read ) */
-#ifndef CURL_DISABLE_RTSP
- if(excess > 0 && !conn->bits.stream_was_rewound &&
- (conn->handler->protocol & CURLPROTO_RTSP)) {
- /* Check for RTP after the content if there is unrewound excess */
-
+ if(conn->handler->readwrite &&
+ (excess > 0 && !conn->bits.stream_was_rewound)) {
/* Parse the excess data */
k->str += nread;
nread = (ssize_t)excess;
- result = Curl_rtsp_rtp_readwrite(data, conn, &nread, &readmore);
+ result = conn->handler->readwrite(data, conn, &nread, &readmore);
if(result)
return result;
k->keepon |= KEEP_RECV; /* we're not done reading */
break;
}
-#endif
if(is_empty_data) {
/* if we received nothing, the server closed the connection and we
ZERO_NULL, /* doing_getsock */
ZERO_NULL, /* perform_getsock */
ZERO_NULL, /* disconnect */
+ ZERO_NULL, /* readwrite */
0, /* defport */
0, /* protocol */
PROTOPT_NONE /* flags */
*/
CURLcode (*disconnect)(struct connectdata *, bool dead_connection);
+ /* If used, this function gets called from transfer.c:readwrite_data() to
+ allow the protocol to do extra reads/writes */
+ CURLcode (*readwrite)(struct SessionHandle *data, struct connectdata *conn,
+ ssize_t *nread, bool *readmore);
+
long defport; /* Default port. */
unsigned int protocol; /* See CURLPROTO_* */
unsigned int flags; /* Extra particular characteristics, see PROTOPT_* */