25 #ifndef CURL_DISABLE_DICT 27 #ifdef HAVE_NETINET_IN_H 28 #include <netinet/in.h> 33 #ifdef HAVE_ARPA_INET_H 34 #include <arpa/inet.h> 39 #ifdef HAVE_SYS_IOCTL_H 40 #include <sys/ioctl.h> 43 #ifdef HAVE_SYS_PARAM_H 44 #include <sys/param.h> 47 #ifdef HAVE_SYS_SELECT_H 48 #include <sys/select.h> 107 dictp =
malloc(((
size_t)len)*2 + 1);
114 if((ch <= 32) || (ch == 127) ||
115 (ch ==
'\'') || (ch ==
'\"') || (ch ==
'\\')) {
116 dictp[olen++] =
'\\';
131 char *database = NULL;
132 char *strategy = NULL;
152 word = strchr(path,
':');
155 database = strchr(word,
':');
157 *database++ = (char)0;
158 strategy = strchr(database,
':');
160 *strategy++ = (char)0;
161 nthdef = strchr(strategy,
':');
169 if((word == NULL) || (*word == (char)0)) {
170 infof(data,
"lookup word is missing\n");
171 word = (
char *)
"default";
173 if((database == NULL) || (*database == (char)0)) {
174 database = (
char *)
"!";
176 if((strategy == NULL) || (*strategy == (char)0)) {
177 strategy = (
char *)
".";
200 failf(data,
"Failed sending DICT request");
210 word = strchr(path,
':');
213 database = strchr(word,
':');
215 *database++ = (char)0;
216 nthdef = strchr(database,
':');
223 if((word == NULL) || (*word == (char)0)) {
224 infof(data,
"lookup word is missing\n");
225 word = (
char *)
"default";
227 if((database == NULL) || (*database == (char)0)) {
228 database = (
char *)
"!";
247 failf(data,
"Failed sending DICT request");
255 ppath = strchr(path,
'/');
260 for(i = 0; ppath[
i]; i++) {
269 failf(data,
"Failed sending DICT request");
CURLcode Curl_urldecode(struct Curl_easy *data, const char *string, size_t length, char **ostring, size_t *olen, bool reject_ctrl)
#define PROTOPT_NOURLQUERY
static CURLcode dict_do(struct connectdata *conn, bool *done)
UNITTEST_START char * ptr
const struct Curl_handler Curl_handler_dict
UNITTEST_START int result
void Curl_setup_transfer(struct connectdata *conn, int sockindex, curl_off_t size, bool getheader, curl_off_t *bytecountp, int writesockindex, curl_off_t *writecountp)
static char * unescape_word(struct Curl_easy *data, const char *inputbuff)
#define strncasecompare(a, b, c)
CURL_TYPEOF_CURL_OFF_T curl_off_t
CURLcode Curl_sendf(curl_socket_t sockfd, struct connectdata *conn, const char *fmt,...)