diff options
author | Patrick Monnerat <Patrick.Monnerat@datasphere.ch> | 2007-10-12 13:36:37 +0000 |
---|---|---|
committer | Patrick Monnerat <Patrick.Monnerat@datasphere.ch> | 2007-10-12 13:36:37 +0000 |
commit | 07b6e7363d910ad4828376d568a2f19fd8d64661 (patch) | |
tree | 1b61554caff5805e38ee72f2151e80c0675610ae /lib/telnet.c | |
parent | 2741f97a69e79a8489e395f105bff0d92567bc21 (diff) | |
download | curl-07b6e7363d910ad4828376d568a2f19fd8d64661.tar.gz |
Added per-protocol callback static tables, replacing callback ptr storage
in the connectdata structure by a single handler table ptr.
Diffstat (limited to 'lib/telnet.c')
-rw-r--r-- | lib/telnet.c | 31 |
1 files changed, 29 insertions, 2 deletions
diff --git a/lib/telnet.c b/lib/telnet.c index 93a598252..b7c470125 100644 --- a/lib/telnet.c +++ b/lib/telnet.c @@ -125,6 +125,10 @@ static void printsub(struct SessionHandle *data, size_t length); static void suboption(struct connectdata *); +static CURLcode Curl_telnet(struct connectdata *conn, bool *done); +static CURLcode Curl_telnet_done(struct connectdata *conn, + CURLcode, bool premature); + /* For negotiation compliant to RFC 1143 */ #define CURL_NO 0 #define CURL_YES 1 @@ -170,6 +174,28 @@ struct TELNET { TelnetReceive telrcv_state; }; + +/* + * TELNET protocol handler. + */ + +const struct Curl_handler Curl_handler_telnet = { + "TELNET", /* scheme */ + NULL, /* setup_connection */ + Curl_telnet, /* do_it */ + Curl_telnet_done, /* done */ + NULL, /* do_more */ + NULL, /* connect_it */ + NULL, /* connecting */ + NULL, /* doing */ + NULL, /* proto_getsock */ + NULL, /* doing_getsock */ + NULL, /* disconnect */ + PORT_TELNET, /* defport */ + PROT_TELNET /* protocol */ +}; + + #ifdef USE_WINSOCK static CURLcode check_wsock2 ( struct SessionHandle *data ) @@ -1074,7 +1100,8 @@ void telrcv(struct connectdata *conn, } } -CURLcode Curl_telnet_done(struct connectdata *conn, CURLcode status, bool premature) +static CURLcode Curl_telnet_done(struct connectdata *conn, + CURLcode status, bool premature) { struct TELNET *tn = (struct TELNET *)conn->data->reqdata.proto.telnet; (void)status; /* unused */ @@ -1088,7 +1115,7 @@ CURLcode Curl_telnet_done(struct connectdata *conn, CURLcode status, bool premat return CURLE_OK; } -CURLcode Curl_telnet(struct connectdata *conn, bool *done) +static CURLcode Curl_telnet(struct connectdata *conn, bool *done) { CURLcode code; struct SessionHandle *data = conn->data; |