comparison lib/rfc2068.c @ 369:c63208a1f0f1

2003-1-18 Brian Masney <masneyb@gftp.org> * lib/misc.c (gftp_build_path) - when checking for already existing /'s, not only look at the end of the currently built string, but look at the beginning of the token that is about to be added (from Aurelien Jarno <aurel32@debian.org>) * lib/rfc2068.c (rfc2068_list_files) - if the current directory is /, just send the hostname over to the HTTP server. This was broken on some HTTP servers. (from Aurelien Jarno <aurel32@debian.org>)
author masneyb
date Sun, 18 Jan 2004 20:30:08 +0000
parents eedc2c5727fa
children 44b792841e3f
comparison
equal deleted inserted replaced
368:af541d789f4c 369:c63208a1f0f1
412 g_return_val_if_fail (request->protonum == GFTP_HTTP_NUM, GFTP_EFATAL); 412 g_return_val_if_fail (request->protonum == GFTP_HTTP_NUM, GFTP_EFATAL);
413 413
414 params = request->protocol_data; 414 params = request->protocol_data;
415 gftp_lookup_request_option (request, "use_http11", &use_http11); 415 gftp_lookup_request_option (request, "use_http11", &use_http11);
416 416
417 hd = gftp_build_path (request->hostname, request->directory, NULL); 417 if (strncmp (request->directory, "/", strlen (request->directory)) == 0)
418 hd = g_strdup (request->hostname);
419 else
420 hd = gftp_build_path (request->hostname, request->directory, NULL);
418 421
419 if (request->username == NULL || *request->username == '\0') 422 if (request->username == NULL || *request->username == '\0')
420 tempstr = g_strconcat ("GET ", request->url_prefix, "://", hd, 423 tempstr = g_strconcat ("GET ", request->url_prefix, "://", hd,
421 use_http11 ? "/ HTTP/1.1\n" : "/ HTTP/1.0\n", NULL); 424 use_http11 ? "/ HTTP/1.1\n" : "/ HTTP/1.0\n", NULL);
422 else 425 else