public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/globus-gass-transfer] rawhide: Fix compiler and doxygen warnings
@ 2026-06-14 8:46 Mattias Ellert
0 siblings, 0 replies; only message in thread
From: Mattias Ellert @ 2026-06-14 8:46 UTC (permalink / raw)
To: git-commits
A new commit has been pushed.
Repo : rpms/globus-gass-transfer
Branch : rawhide
Commit : 8110ebb17f4d78a2096e2f05471424f3a8f5a237
Author : Mattias Ellert <mattias.ellert@physics.uu.se>
Date : 2026-06-14T10:39:13+02:00
Stats : +11120/-1 in 3 file(s)
URL : https://src.fedoraproject.org/rpms/globus-gass-transfer/c/8110ebb17f4d78a2096e2f05471424f3a8f5a237?branch=rawhide
Log:
Fix compiler and doxygen warnings
---
diff --git a/0001-Untabify-and-remove-trailing-white-space.patch b/0001-Untabify-and-remove-trailing-white-space.patch
new file mode 100644
index 0000000..e59186a
--- /dev/null
+++ b/0001-Untabify-and-remove-trailing-white-space.patch
@@ -0,0 +1,10980 @@
+From 3ccdaa0236230bbcbcbf339e7dfdfaf23c10bd6f Mon Sep 17 00:00:00 2001
+From: Mattias Ellert <mattias.ellert@physics.uu.se>
+Date: Wed, 20 May 2026 00:15:37 +0200
+Subject: [PATCH 1/2] Untabify and remove trailing white-space
+
+---
+ .../source/library/globus_gass_transfer.c | 136 +-
+ .../source/library/globus_gass_transfer.h | 426 +-
+ .../library/globus_gass_transfer_http.c | 7070 ++++++++---------
+ .../library/globus_gass_transfer_request.c | 408 +-
+ 4 files changed, 4020 insertions(+), 4020 deletions(-)
+
+diff --git a/gass/transfer/source/library/globus_gass_transfer.c b/gass/transfer/source/library/globus_gass_transfer.c
+index 122e12187..1bc3b27f2 100644
+--- a/gass/transfer/source/library/globus_gass_transfer.c
++++ b/gass/transfer/source/library/globus_gass_transfer.c
+@@ -57,8 +57,8 @@ globus_module_descriptor_t globus_i_gass_transfer_module =
+ static
+ void
+ globus_l_gass_transfer_listener_close_callback(
+- void * user_arg,
+- globus_gass_transfer_listener_t request);
++ void * user_arg,
++ globus_gass_transfer_listener_t request);
+
+ static
+ int
+@@ -67,9 +67,9 @@ globus_l_gass_transfer_activate(void)
+ globus_module_activate(GLOBUS_COMMON_MODULE);
+
+ globus_hashtable_init(&globus_i_gass_transfer_protocols,
+- 16,
+- globus_hashtable_string_hash,
+- globus_hashtable_string_keyeq);
++ 16,
++ globus_hashtable_string_hash,
++ globus_hashtable_string_keyeq);
+
+ globus_handle_table_init(
+ &globus_i_gass_transfer_request_handles,
+@@ -85,25 +85,25 @@ globus_l_gass_transfer_activate(void)
+ */
+ globus_module_activate(GLOBUS_I_GASS_TRANSFER_FTP_MODULE);
+ #endif
+-
++
+ globus_gass_transfer_proto_register_protocol(
+- &globus_i_gass_transfer_http_descriptor);
++ &globus_i_gass_transfer_http_descriptor);
+ globus_gass_transfer_proto_register_protocol(
+- &globus_i_gass_transfer_https_descriptor);
++ &globus_i_gass_transfer_https_descriptor);
+
+ #if 0
+ /* we don't want to build this in
+ */
+ globus_gass_transfer_proto_register_protocol(
+- &globus_i_gass_transfer_ftp_descriptor);
++ &globus_i_gass_transfer_ftp_descriptor);
+ globus_gass_transfer_proto_register_protocol(
+- &globus_i_gass_transfer_gsiftp_descriptor);
++ &globus_i_gass_transfer_gsiftp_descriptor);
+ #endif
+-
++
+ globus_mutex_init(&globus_i_gass_transfer_mutex,
+ GLOBUS_NULL);
+ globus_cond_init(&globus_i_gass_transfer_shutdown_cond,
+- GLOBUS_NULL);
++ GLOBUS_NULL);
+
+ return GLOBUS_SUCCESS;
+ }
+@@ -113,40 +113,40 @@ static
+ int
+ globus_l_gass_transfer_deactivate(void)
+ {
+- globus_list_t * rest;
++ globus_list_t * rest;
+
+ globus_i_gass_transfer_lock();
+ globus_i_gass_transfer_deactivating = GLOBUS_TRUE;
+-
++
+ #if DEBUG_GASS_TRANSFER
+ printf(_GTSL("Entering globus_l_gass_transfer_deactivate()\n"));
+ #endif
+-
++
+ rest = globus_i_gass_transfer_requests;
+-
++
+ while(!globus_list_empty(rest))
+ {
+- globus_gass_transfer_request_t tmp;
+- globus_gass_transfer_request_struct_t * req;
+- int rc;
++ globus_gass_transfer_request_t tmp;
++ globus_gass_transfer_request_struct_t * req;
++ int rc;
++
++ tmp = (globus_gass_transfer_request_t) (intptr_t)
++ globus_list_first(rest);
+
+- tmp = (globus_gass_transfer_request_t) (intptr_t)
+- globus_list_first(rest);
++ rest = globus_list_rest(rest);
+
+- rest = globus_list_rest(rest);
++ req = globus_handle_table_lookup(
++ &globus_i_gass_transfer_request_handles,
++ tmp);
+
+- req = globus_handle_table_lookup(
+- &globus_i_gass_transfer_request_handles,
+- tmp);
+-
+ #if DEBUG_GASS_TRANSFER
+- printf(_GTSL("failing: %s\n"), req->url);
++ printf(_GTSL("failing: %s\n"), req->url);
+ #endif
+- rc = globus_i_gass_transfer_fail(
+- tmp,
+- req,
+- globus_i_gass_transfer_deactivate_callback,
+- GLOBUS_NULL);
++ rc = globus_i_gass_transfer_fail(
++ tmp,
++ req,
++ globus_i_gass_transfer_deactivate_callback,
++ GLOBUS_NULL);
+
+ if (rc == GLOBUS_GASS_TRANSFER_ERROR_DONE)
+ {
+@@ -159,51 +159,51 @@ globus_l_gass_transfer_deactivate(void)
+
+ while(!globus_list_empty(rest))
+ {
+- globus_gass_transfer_listener_t tmp;
+- globus_gass_transfer_listener_struct_t *l;
+- int rc;
+-
+- tmp = (globus_gass_transfer_listener_t) (intptr_t)
+- globus_list_first(rest);
+-
+- rest = globus_list_rest(rest);
+-
+- l = globus_handle_table_lookup(
+- &globus_i_gass_transfer_listener_handles,
+- tmp);
+-
+- rc = globus_i_gass_transfer_close_listener(
+- tmp,
+- l,
+- globus_l_gass_transfer_listener_close_callback,
+- GLOBUS_NULL);
++ globus_gass_transfer_listener_t tmp;
++ globus_gass_transfer_listener_struct_t *l;
++ int rc;
++
++ tmp = (globus_gass_transfer_listener_t) (intptr_t)
++ globus_list_first(rest);
++
++ rest = globus_list_rest(rest);
++
++ l = globus_handle_table_lookup(
++ &globus_i_gass_transfer_listener_handles,
++ tmp);
++
++ rc = globus_i_gass_transfer_close_listener(
++ tmp,
++ l,
++ globus_l_gass_transfer_listener_close_callback,
++ GLOBUS_NULL);
+ }
+-
++
+ while((!globus_list_empty(globus_i_gass_transfer_requests)) ||
+- (!globus_list_empty(globus_i_gass_transfer_listeners)))
++ (!globus_list_empty(globus_i_gass_transfer_listeners)))
+ {
+ #if DEBUG_GASS_TRANSFER
+- printf(_GTSL("waiting for requests\n"));
++ printf(_GTSL("waiting for requests\n"));
+ #endif
+- globus_cond_wait(&globus_i_gass_transfer_shutdown_cond,
+- &globus_i_gass_transfer_mutex);
++ globus_cond_wait(&globus_i_gass_transfer_shutdown_cond,
++ &globus_i_gass_transfer_mutex);
+ }
+
+ #if 0
+ /* we don't want to build this in
+ */
+ globus_gass_transfer_proto_unregister_protocol(
+- &globus_i_gass_transfer_ftp_descriptor);
++ &globus_i_gass_transfer_ftp_descriptor);
+ globus_gass_transfer_proto_unregister_protocol(
+- &globus_i_gass_transfer_gsiftp_descriptor);
++ &globus_i_gass_transfer_gsiftp_descriptor);
+ #endif
+-
++
+ globus_gass_transfer_proto_unregister_protocol(
+- &globus_i_gass_transfer_http_descriptor);
++ &globus_i_gass_transfer_http_descriptor);
+ globus_gass_transfer_proto_unregister_protocol(
+- &globus_i_gass_transfer_https_descriptor);
++ &globus_i_gass_transfer_https_descriptor);
++
+
+-
+ #if 0
+ /* we don't want to build this in
+ */
+@@ -211,13 +211,13 @@ globus_l_gass_transfer_deactivate(void)
+ #endif
+
+ globus_i_gass_transfer_unlock();
+-
++
+ globus_module_deactivate(GLOBUS_I_GASS_TRANSFER_HTTP_MODULE);
+-
++
+ globus_handle_table_destroy(&globus_i_gass_transfer_listener_handles);
+ globus_handle_table_destroy(&globus_i_gass_transfer_request_handles);
+
+-
++
+ globus_hashtable_destroy(&globus_i_gass_transfer_protocols);
+
+ #if !defined(BUILD_LITE)
+@@ -236,8 +236,8 @@ globus_l_gass_transfer_deactivate(void)
+
+ void
+ globus_i_gass_transfer_deactivate_callback(
+- void * user_arg,
+- globus_gass_transfer_request_t request)
++ void * user_arg,
++ globus_gass_transfer_request_t request)
+ {
+ globus_i_gass_transfer_request_destroy(request);
+ }
+@@ -245,8 +245,8 @@ globus_i_gass_transfer_deactivate_callback(
+ static
+ void
+ globus_l_gass_transfer_listener_close_callback(
+- void * user_arg,
+- globus_gass_transfer_listener_t request)
++ void * user_arg,
++ globus_gass_transfer_listener_t request)
+ {
+ return;
+ }
+diff --git a/gass/transfer/source/library/globus_gass_transfer.h b/gass/transfer/source/library/globus_gass_transfer.h
+index e0fb783f7..650fb402c 100644
+--- a/gass/transfer/source/library/globus_gass_transfer.h
++++ b/gass/transfer/source/library/globus_gass_transfer.h
+@@ -58,7 +58,7 @@ extern "C" {
+ * The GASS Transfer API is easily extensible to support different remote
+ * data access protocols. The standard Globus distribution includes client-side
+ * support for the http, and https protocols, as well as
+- * server-side support for the http and https protocols.
++ * server-side support for the http and https protocols.
+ * An application which requires additional
+ * protocol support may add this through the @link
+ * globus_gass_transfer_protocol protocol module interface@endlink.
+@@ -92,17 +92,17 @@ extern "C" {
+ * globus_module_deactivate(GLOBUS_GASS_TRANSFER_MODULE);
+ * @endcode
+ */
+-extern globus_module_descriptor_t globus_i_gass_transfer_module;
++extern globus_module_descriptor_t globus_i_gass_transfer_module;
+
+ /** Module descriptor
+ * @ingroup globus_gass_transfer_activation
+ * @hideinitializer
+ */
+-#define GLOBUS_GASS_TRANSFER_MODULE (&globus_i_gass_transfer_module)
++#define GLOBUS_GASS_TRANSFER_MODULE (&globus_i_gass_transfer_module)
+
+ #define _GTSL(s) globus_common_i18n_get_string( \
+- GLOBUS_GASS_TRANSFER_MODULE, \
+- s)
++ GLOBUS_GASS_TRANSFER_MODULE, \
++ s)
+ /**
+ * @struct globus_gass_transfer_request_t
+ * @ingroup globus_gass_transfer_request
+@@ -175,10 +175,10 @@ typedef enum
+ * GLOBUS_GASS_TRANSFER_REQUEST_INVALID
+ * GLOBUS_GASS_TRANSFER_REQUEST_STARTING
+ * GLOBUS_GASS_TRANSFER_REQUEST_PENDING (PENDING, ACTING,
+- * ACTING_TO_PENDING)
++ * ACTING_TO_PENDING)
+ * GLOBUS_GASS_TRANSFER_REQUEST_FAILED (FAILED, USER_FAIL, ACTING_TO_FAIL)
+ * GLOBUS_GASS_TRANSFER_REQUEST_REFERRED (REFERRING, ACTING_TO_REFERRING,
+- * ACTING_TO_REFERRING2)
++ * ACTING_TO_REFERRING2)
+ * GLOBUS_GASS_TRANSFER_REQUEST_DENIED
+ * GLOBUS_GASS_TRANSFER_REQUEST_DONE
+ */
+@@ -191,45 +191,45 @@ typedef enum
+ GLOBUS_GASS_TRANSFER_REQUEST_INVALID, /**< Handle is no longer valid */
+ GLOBUS_GASS_TRANSFER_REQUEST_STARTING, /**< Initial connection and
+ authorization is not yet
+- completed */
++ completed */
+ GLOBUS_GASS_TRANSFER_REQUEST_PENDING, /**< Request is authorized. */
+ GLOBUS_GASS_TRANSFER_REQUEST_FAILED, /**< Request failed due to protocol
+ error or client or server
+- aborting the request */
++ aborting the request */
+ GLOBUS_GASS_TRANSFER_REQUEST_REFERRED, /**< Request can not be processed
+ by this server, referred to
+- another URL or URLs */
++ another URL or URLs */
+ GLOBUS_GASS_TRANSFER_REQUEST_DENIED, /**< The server denied this
+ request */
+ GLOBUS_GASS_TRANSFER_REQUEST_DONE, /**< All callbacks have completed */
+ #ifndef GLOBUS_DONT_DOCUMENT_INTERNAL
+ GLOBUS_GASS_TRANSFER_REQUEST_ACCEPTING,/**< for listener-created requests,
+- the state before starting,
+- after the user has called
+- register_accept, but before the
+- callback is done */
++ the state before starting,
++ after the user has called
++ register_accept, but before the
++ callback is done */
+ GLOBUS_GASS_TRANSFER_REQUEST_ACTING, /* op passed to request */
+ GLOBUS_GASS_TRANSFER_REQUEST_ACTING_TO_PENDING, /* calling back to user */
+ GLOBUS_GASS_TRANSFER_REQUEST_ACTING_TO_FAILING, /* op passed to request, and
+- user called fail */
++ user called fail */
+ GLOBUS_GASS_TRANSFER_REQUEST_FAILING, /* user called fail, or op
+- completed, user callback
+- started */
++ completed, user callback
++ started */
+ GLOBUS_GASS_TRANSFER_REQUEST_USER_FAIL, /* user called fail before
+- ready/referred/denied */
+- GLOBUS_GASS_TRANSFER_REQUEST_REFERRING, /* proto called referred,
+- callback pending */
++ ready/referred/denied */
++ GLOBUS_GASS_TRANSFER_REQUEST_REFERRING, /* proto called referred,
++ callback pending */
+ GLOBUS_GASS_TRANSFER_REQUEST_ACTING_TO_REFERRING, /* proto called referred,
+- op in progress */
++ op in progress */
+ GLOBUS_GASS_TRANSFER_REQUEST_FINISHING, /* op completed successfully,
+- with last data, user callback
+- started*/
++ with last data, user callback
++ started*/
+ GLOBUS_GASS_TRANSFER_REQUEST_SERVER_FAIL1, /* user called fail before
+- new_listener_request */
++ new_listener_request */
+ GLOBUS_GASS_TRANSFER_REQUEST_SERVER_FAIL2, /* user called fail before
+- authorize/refer/deny */
++ authorize/refer/deny */
+ GLOBUS_GASS_TRANSFER_REQUEST_SERVER_FAIL3, /* user called fail before
+- request_ready */
++ request_ready */
+ GLOBUS_GASS_TRANSFER_REQUEST_STARTING2, /* server not authorized/denied/failed */
+ GLOBUS_GASS_TRANSFER_REQUEST_STARTING3 /* server not authorized/denied/failed */
+ #endif
+@@ -240,13 +240,13 @@ typedef enum
+ GLOBUS_GASS_TRANSFER_LISTENER_INVALID, /* handle no longer valid */
+ GLOBUS_GASS_TRANSFER_LISTENER_STARTING, /* new listener called */
+ GLOBUS_GASS_TRANSFER_LISTENER_LISTENING, /* register listen/
+- proto->register listen */
++ proto->register listen */
+ GLOBUS_GASS_TRANSFER_LISTENER_READY, /* proto calls listener_ready */
+ GLOBUS_GASS_TRANSFER_LISTENER_ACCEPTING, /* register_accept() */
+ GLOBUS_GASS_TRANSFER_LISTENER_CLOSING1, /* close_listener before
+- listener_ready called */
++ listener_ready called */
+ GLOBUS_GASS_TRANSFER_LISTENER_CLOSING2, /* close listener before
+- new_request */
++ new_request */
+ GLOBUS_GASS_TRANSFER_LISTENER_CLOSED /* listener is closed */
+ } globus_gass_transfer_listener_status_t;
+
+@@ -324,8 +324,8 @@ enum
+
+ typedef void
+ (* globus_gass_transfer_callback_t)(
+- void * arg,
+- globus_gass_transfer_request_t request);
++ void * arg,
++ globus_gass_transfer_request_t request);
+ /* Client Interface */
+ /**
+ * @brief GASS Transfer Client Operations
+@@ -350,49 +350,49 @@ typedef void
+ */
+ int
+ globus_gass_transfer_register_get(
+- globus_gass_transfer_request_t * request,
+- globus_gass_transfer_requestattr_t * attr,
+- char * url,
+- globus_gass_transfer_callback_t callback,
+- void * user_arg);
++ globus_gass_transfer_request_t * request,
++ globus_gass_transfer_requestattr_t * attr,
++ char * url,
++ globus_gass_transfer_callback_t callback,
++ void * user_arg);
+
+ int
+ globus_gass_transfer_get(
+- globus_gass_transfer_request_t * request,
+- globus_gass_transfer_requestattr_t * attr,
+- char * url);
++ globus_gass_transfer_request_t * request,
++ globus_gass_transfer_requestattr_t * attr,
++ char * url);
+
+ int
+ globus_gass_transfer_register_put(
+- globus_gass_transfer_request_t * request,
+- globus_gass_transfer_requestattr_t * attr,
+- char * url,
+- globus_size_t length,
+- globus_gass_transfer_callback_t callback,
+- void * user_arg);
++ globus_gass_transfer_request_t * request,
++ globus_gass_transfer_requestattr_t * attr,
++ char * url,
++ globus_size_t length,
++ globus_gass_transfer_callback_t callback,
++ void * user_arg);
+
+ int
+ globus_gass_transfer_put(
+- globus_gass_transfer_request_t * request,
+- globus_gass_transfer_requestattr_t * attr,
+- char * url,
+- globus_size_t length);
++ globus_gass_transfer_request_t * request,
++ globus_gass_transfer_requestattr_t * attr,
++ char * url,
++ globus_size_t length);
+
+ int
+ globus_gass_transfer_register_append(
+- globus_gass_transfer_request_t * request,
+- globus_gass_transfer_requestattr_t * attr,
+- char * url,
+- globus_size_t length,
+- globus_gass_transfer_callback_t callback,
+- void * user_arg);
++ globus_gass_transfer_request_t * request,
++ globus_gass_transfer_requestattr_t * attr,
++ char * url,
++ globus_size_t length,
++ globus_gass_transfer_callback_t callback,
++ void * user_arg);
+
+ int
+ globus_gass_transfer_append(
+- globus_gass_transfer_request_t * request,
+- globus_gass_transfer_requestattr_t * attr,
+- char * url,
+- globus_size_t length);
++ globus_gass_transfer_request_t * request,
++ globus_gass_transfer_requestattr_t * attr,
++ char * url,
++ globus_size_t length);
+
+ /**
+ * @brief GASS Server Implementation
+@@ -404,7 +404,7 @@ globus_gass_transfer_append(
+ * Another mode of using the GASS Transfer API is to implement
+ * data servers. The primary difference between the client and
+ * server parts of the GASS Transfer API are how requests are generated.
+- *
++ *
+ * To implement a server, the user would call
+ * globus_gass_transfer_create_listener() to create a new server port on
+ * which a specific protocol will be used to request file transfer operations.
+@@ -432,8 +432,8 @@ globus_gass_transfer_append(
+ */
+ typedef void
+ (* globus_gass_transfer_close_callback_t)(
+- void * callback_arg,
+- globus_gass_transfer_listener_t listener);
++ void * callback_arg,
++ globus_gass_transfer_listener_t listener);
+
+ /**
+ * Listen callback.
+@@ -443,64 +443,64 @@ typedef void
+ */
+ typedef void
+ (* globus_gass_transfer_listen_callback_t)(
+- void * callback_arg,
+- globus_gass_transfer_listener_t listener);
++ void * callback_arg,
++ globus_gass_transfer_listener_t listener);
+
+ int
+ globus_gass_transfer_create_listener(
+- globus_gass_transfer_listener_t * listener,
+- globus_gass_transfer_listenerattr_t * attr,
+- char * scheme);
++ globus_gass_transfer_listener_t * listener,
++ globus_gass_transfer_listenerattr_t * attr,
++ char * scheme);
+
+ int
+ globus_gass_transfer_close_listener(
+- globus_gass_transfer_listener_t listener,
+- globus_gass_transfer_close_callback_t callback,
+- void * user_arg);
++ globus_gass_transfer_listener_t listener,
++ globus_gass_transfer_close_callback_t callback,
++ void * user_arg);
+
+ int
+ globus_gass_transfer_register_listen(
+- globus_gass_transfer_listener_t listener,
+- globus_gass_transfer_listen_callback_t callback,
+- void * user_arg);
++ globus_gass_transfer_listener_t listener,
++ globus_gass_transfer_listen_callback_t callback,
++ void * user_arg);
+
+ int
+ globus_gass_transfer_register_accept(
+- globus_gass_transfer_request_t * request,
+- globus_gass_transfer_requestattr_t * attr,
+- globus_gass_transfer_listener_t listener,
+- globus_gass_transfer_callback_t callback,
+- void * user_arg);
++ globus_gass_transfer_request_t * request,
++ globus_gass_transfer_requestattr_t * attr,
++ globus_gass_transfer_listener_t listener,
++ globus_gass_transfer_callback_t callback,
++ void * user_arg);
+
+ int
+ globus_gass_transfer_refer(
+- globus_gass_transfer_request_t request,
+- char ** urls,
+- globus_size_t num_urls);
++ globus_gass_transfer_request_t request,
++ char ** urls,
++ globus_size_t num_urls);
+
+ int
+ globus_gass_transfer_authorize(
+- globus_gass_transfer_request_t request,
+- globus_size_t total_length);
++ globus_gass_transfer_request_t request,
++ globus_size_t total_length);
+
+ int
+ globus_gass_transfer_deny(
+- globus_gass_transfer_request_t request,
+- int reason,
+- char * message);
++ globus_gass_transfer_request_t request,
++ int reason,
++ char * message);
+
+ char *
+ globus_gass_transfer_listener_get_base_url(
+- globus_gass_transfer_listener_t listener);
++ globus_gass_transfer_listener_t listener);
+
+ void *
+ globus_gass_transfer_listener_get_user_pointer(
+- globus_gass_transfer_listener_t listener);
++ globus_gass_transfer_listener_t listener);
+
+ int
+ globus_gass_transfer_listener_set_user_pointer(
+- globus_gass_transfer_listener_t listener,
+- void * user_pointer);
++ globus_gass_transfer_listener_t listener,
++ void * user_pointer);
+
+ /**
+ * @defgroup globus_gass_transfer_data Sending and Receiving Data
+@@ -529,35 +529,35 @@ globus_gass_transfer_listener_set_user_pointer(
+ */
+ typedef void
+ (* globus_gass_transfer_bytes_callback_t)(
+- void * arg,
+- globus_gass_transfer_request_t request,
+- globus_byte_t * bytes,
+- globus_size_t length,
+- globus_bool_t last_data);
++ void * arg,
++ globus_gass_transfer_request_t request,
++ globus_byte_t * bytes,
++ globus_size_t length,
++ globus_bool_t last_data);
+
+ int
+ globus_gass_transfer_send_bytes(
+- globus_gass_transfer_request_t request,
+- globus_byte_t * bytes,
+- globus_size_t send_length,
+- globus_bool_t last_data,
+- globus_gass_transfer_bytes_callback_t callback,
+- void * user_arg);
++ globus_gass_transfer_request_t request,
++ globus_byte_t * bytes,
++ globus_size_t send_length,
++ globus_bool_t last_data,
++ globus_gass_transfer_bytes_callback_t callback,
++ void * user_arg);
+
+ int
+ globus_gass_transfer_receive_bytes(
+- globus_gass_transfer_request_t request,
+- globus_byte_t * bytes,
+- globus_size_t max_length,
+- globus_size_t wait_for_length,
+- globus_gass_transfer_bytes_callback_t callback,
+- void * user_arg);
++ globus_gass_transfer_request_t request,
++ globus_byte_t * bytes,
++ globus_size_t max_length,
++ globus_size_t wait_for_length,
++ globus_gass_transfer_bytes_callback_t callback,
++ void * user_arg);
+
+ int
+ globus_gass_transfer_fail(
+- globus_gass_transfer_request_t request,
+- globus_gass_transfer_callback_t callback,
+- void * user_arg);
++ globus_gass_transfer_request_t request,
++ globus_gass_transfer_callback_t callback,
++ void * user_arg);
+ /**
+ * @brief GASS Referrals
+ *
+@@ -579,23 +579,23 @@ globus_gass_transfer_fail(
+ #ifndef DOXYGEN
+ typedef struct
+ {
+- char ** url;
+- globus_size_t count;
++ char ** url;
++ globus_size_t count;
+ } globus_gass_transfer_referral_t;
+
+
+ globus_size_t
+ globus_gass_transfer_referral_get_count(
+- globus_gass_transfer_referral_t * referral);
++ globus_gass_transfer_referral_t * referral);
+
+ char *
+ globus_gass_transfer_referral_get_url(
+- globus_gass_transfer_referral_t * referral,
+- globus_size_t index);
++ globus_gass_transfer_referral_t * referral,
++ globus_size_t index);
+
+ int
+ globus_gass_transfer_referral_destroy(
+- globus_gass_transfer_referral_t * referral);
++ globus_gass_transfer_referral_t * referral);
+
+ #endif
+
+@@ -631,64 +631,64 @@ globus_gass_transfer_referral_destroy(
+ #ifndef DOXYGEN
+ globus_gass_transfer_request_type_t
+ globus_gass_transfer_request_get_type(
+- globus_gass_transfer_request_t request);
++ globus_gass_transfer_request_t request);
+
+ globus_gass_transfer_request_status_t
+ globus_gass_transfer_request_get_status(
+- globus_gass_transfer_request_t request);
++ globus_gass_transfer_request_t request);
+
+ char *
+ globus_gass_transfer_request_get_subject(
+- globus_gass_transfer_request_t request);
++ globus_gass_transfer_request_t request);
+
+ int
+ globus_gass_transfer_request_set_subject(
+- globus_gass_transfer_request_t request,
+- char * subject);
++ globus_gass_transfer_request_t request,
++ char * subject);
+
+ int
+ globus_gass_transfer_request_get_referral(
+- globus_gass_transfer_request_t request,
+- globus_gass_transfer_referral_t * referral);
++ globus_gass_transfer_request_t request,
++ globus_gass_transfer_referral_t * referral);
+
+ char *
+ globus_gass_transfer_request_get_url(
+- globus_gass_transfer_request_t request);
++ globus_gass_transfer_request_t request);
+
+ int
+ globus_gass_transfer_request_set_url(
+- globus_gass_transfer_request_t request,
+- char * url);
++ globus_gass_transfer_request_t request,
++ char * url);
+
+ globus_size_t
+ globus_gass_transfer_request_get_length(
+- globus_gass_transfer_request_t request);
++ globus_gass_transfer_request_t request);
+
+ int
+ globus_gass_transfer_request_get_denial_reason(
+- globus_gass_transfer_request_t request);
++ globus_gass_transfer_request_t request);
+
+ char *
+ globus_gass_transfer_request_get_denial_message(
+- globus_gass_transfer_request_t request);
++ globus_gass_transfer_request_t request);
+
+ void *
+ globus_gass_transfer_request_get_user_pointer(
+- globus_gass_transfer_request_t request);
++ globus_gass_transfer_request_t request);
+
+ int
+ globus_gass_transfer_request_set_user_pointer(
+- globus_gass_transfer_request_t request,
+- void * user_pointer);
++ globus_gass_transfer_request_t request,
++ void * user_pointer);
+
+ int
+ globus_gass_transfer_request_destroy(
+- globus_gass_transfer_request_t request);
++ globus_gass_transfer_request_t request);
+
+ int
+ globus_gass_transfer_request_set_type(
+- globus_gass_transfer_request_t request,
+- globus_gass_transfer_request_type_t type);
++ globus_gass_transfer_request_t request,
++ globus_gass_transfer_request_type_t type);
+ #endif
+
+
+@@ -703,106 +703,106 @@ globus_gass_transfer_request_set_type(
+ #ifndef DOXYGEN
+ int
+ globus_gass_transfer_requestattr_init(
+- globus_gass_transfer_requestattr_t * attr,
+- char * url_scheme);
++ globus_gass_transfer_requestattr_t * attr,
++ char * url_scheme);
+
+ int
+ globus_gass_transfer_requestattr_destroy(
+- globus_gass_transfer_requestattr_t * attr);
++ globus_gass_transfer_requestattr_t * attr);
+
+ int
+ globus_gass_transfer_listenerattr_init(
+- globus_gass_transfer_listenerattr_t * attr,
+- char * url_scheme);
++ globus_gass_transfer_listenerattr_t * attr,
++ char * url_scheme);
+
+ int
+ globus_gass_transfer_listenerattr_destroy(
+- globus_gass_transfer_listenerattr_t * attr);
++ globus_gass_transfer_listenerattr_t * attr);
+
+ /* Base Attribute Accessors */
+ int
+ globus_gass_transfer_requestattr_set_proxy_url(
+- globus_gass_transfer_requestattr_t * attr,
+- char * proxy_url);
++ globus_gass_transfer_requestattr_t * attr,
++ char * proxy_url);
+
+ int
+ globus_gass_transfer_requestattr_get_proxy_url(
+- globus_gass_transfer_requestattr_t * attr,
+- char ** proxy_url);
++ globus_gass_transfer_requestattr_t * attr,
++ char ** proxy_url);
+
+ int
+ globus_gass_transfer_requestattr_set_block_size(
+- globus_gass_transfer_requestattr_t * attr,
+- globus_size_t block_size);
++ globus_gass_transfer_requestattr_t * attr,
++ globus_size_t block_size);
+
+ int
+ globus_gass_transfer_requestattr_get_block_size(
+- globus_gass_transfer_requestattr_t * attr,
+- globus_size_t * block_size);
++ globus_gass_transfer_requestattr_t * attr,
++ globus_size_t * block_size);
+
+ int
+ globus_gass_transfer_requestattr_set_file_mode(
+- globus_gass_transfer_requestattr_t * attr,
+- globus_gass_transfer_file_mode_t file_mode);
++ globus_gass_transfer_requestattr_t * attr,
++ globus_gass_transfer_file_mode_t file_mode);
+
+ int
+ globus_gass_transfer_requestattr_get_file_mode(
+- globus_gass_transfer_requestattr_t * attr,
+- globus_gass_transfer_file_mode_t * file_mode);
++ globus_gass_transfer_requestattr_t * attr,
++ globus_gass_transfer_file_mode_t * file_mode);
+
+ int
+ globus_gass_transfer_requestattr_set_connection_reuse(
+- globus_gass_transfer_requestattr_t * attr,
+- globus_bool_t connection_reuse);
++ globus_gass_transfer_requestattr_t * attr,
++ globus_bool_t connection_reuse);
+
+ int
+ globus_gass_transfer_requestattr_get_connection_reuse(
+- globus_gass_transfer_requestattr_t * attr,
+- globus_bool_t * connection_reuse);
++ globus_gass_transfer_requestattr_t * attr,
++ globus_bool_t * connection_reuse);
+
+ /* Socket Attribute Accessors */
+ int
+ globus_gass_transfer_requestattr_set_socket_sndbuf(
+- globus_gass_transfer_requestattr_t * attr,
+- int sndbuf);
++ globus_gass_transfer_requestattr_t * attr,
++ int sndbuf);
+
+ int
+ globus_gass_transfer_requestattr_get_socket_sndbuf(
+- globus_gass_transfer_requestattr_t * attr,
+- int * sndbuf);
++ globus_gass_transfer_requestattr_t * attr,
++ int * sndbuf);
+
+ int
+ globus_gass_transfer_requestattr_set_socket_rcvbuf(
+- globus_gass_transfer_requestattr_t * attr,
+- int rcvbuf);
++ globus_gass_transfer_requestattr_t * attr,
++ int rcvbuf);
+
+ int
+ globus_gass_transfer_requestattr_get_socket_rcvbuf(
+- globus_gass_transfer_requestattr_t * attr,
+- int * rcvbuf);
++ globus_gass_transfer_requestattr_t * attr,
++ int * rcvbuf);
+
+ int
+ globus_gass_transfer_requestattr_set_socket_nodelay(
+- globus_gass_transfer_requestattr_t * attr,
+- globus_bool_t nodelay);
++ globus_gass_transfer_requestattr_t * attr,
++ globus_bool_t nodelay);
+
+ int
+ globus_gass_transfer_requestattr_get_socket_nodelay(
+- globus_gass_transfer_requestattr_t * attr,
+- globus_bool_t * nodelay);
++ globus_gass_transfer_requestattr_t * attr,
++ globus_bool_t * nodelay);
+
+ /* Security attribute accessors */
+ int
+ globus_gass_transfer_secure_requestattr_set_authorization(
+- globus_gass_transfer_requestattr_t * attr,
+- globus_gass_transfer_authorization_t mode,
+- char * subject);
++ globus_gass_transfer_requestattr_t * attr,
++ globus_gass_transfer_authorization_t mode,
++ char * subject);
+
+ int
+ globus_gass_transfer_secure_requestattr_get_authorization(
+- globus_gass_transfer_requestattr_t * attr,
+- globus_gass_transfer_authorization_t * mode,
+- char ** subject);
++ globus_gass_transfer_requestattr_t * attr,
++ globus_gass_transfer_authorization_t * mode,
++ char ** subject);
+ #endif
+
+ /**
+@@ -813,23 +813,23 @@ globus_gass_transfer_secure_requestattr_get_authorization(
+ #ifndef DOXYGEN
+ int
+ globus_gass_transfer_listenerattr_set_backlog(
+- globus_gass_transfer_listenerattr_t * attr,
+- int backlog);
++ globus_gass_transfer_listenerattr_t * attr,
++ int backlog);
+
+ int
+ globus_gass_transfer_listenerattr_get_backlog(
+- globus_gass_transfer_listenerattr_t * attr,
+- int * backlog);
++ globus_gass_transfer_listenerattr_t * attr,
++ int * backlog);
+
+ int
+ globus_gass_transfer_listenerattr_set_port(
+- globus_gass_transfer_listenerattr_t * attr,
+- unsigned short port);
++ globus_gass_transfer_listenerattr_t * attr,
++ unsigned short port);
+
+ int
+ globus_gass_transfer_listenerattr_get_port(
+- globus_gass_transfer_listenerattr_t * attr,
+- unsigned short * port);
++ globus_gass_transfer_listenerattr_t * attr,
++ unsigned short * port);
+ #endif
+
+ /**
+@@ -841,64 +841,64 @@ extern const globus_object_type_t
+ GLOBUS_GASS_OBJECT_TYPE_REQUESTATTR_DEFINITION;
+
+ #define GLOBUS_GASS_OBJECT_TYPE_REQUESTATTR \
+- (&GLOBUS_GASS_OBJECT_TYPE_REQUESTATTR_DEFINITION)
++ (&GLOBUS_GASS_OBJECT_TYPE_REQUESTATTR_DEFINITION)
+
+ globus_object_t *
+ globus_gass_transfer_requestattr_initialize(
+- globus_object_t * obj,
+- char * proxy_url,
+- globus_size_t block_size,
+- globus_gass_transfer_file_mode_t file_mode,
+- globus_bool_t connection_reuse);
++ globus_object_t * obj,
++ char * proxy_url,
++ globus_size_t block_size,
++ globus_gass_transfer_file_mode_t file_mode,
++ globus_bool_t connection_reuse);
+
+ extern const globus_object_type_t
+ GLOBUS_GASS_OBJECT_TYPE_SOCKET_REQUESTATTR_DEFINITION;
+
+ #define GLOBUS_GASS_OBJECT_TYPE_SOCKET_REQUESTATTR \
+- (&GLOBUS_GASS_OBJECT_TYPE_SOCKET_REQUESTATTR_DEFINITION)
++ (&GLOBUS_GASS_OBJECT_TYPE_SOCKET_REQUESTATTR_DEFINITION)
+
+ globus_object_t *
+ globus_gass_transfer_socket_requestattr_initialize(
+- globus_object_t * obj,
+- char * proxy_url,
+- globus_size_t block_size,
+- globus_gass_transfer_file_mode_t file_mode,
+- globus_bool_t connection_reuse,
+- int sndbuf,
+- int rcvbuf,
+- globus_bool_t nodelay);
++ globus_object_t * obj,
++ char * proxy_url,
++ globus_size_t block_size,
++ globus_gass_transfer_file_mode_t file_mode,
++ globus_bool_t connection_reuse,
++ int sndbuf,
++ int rcvbuf,
++ globus_bool_t nodelay);
+
+ extern const globus_object_type_t
+ GLOBUS_GASS_OBJECT_TYPE_SECURE_REQUESTATTR_DEFINITION;
+
+ #define GLOBUS_GASS_OBJECT_TYPE_SECURE_REQUESTATTR \
+- (&GLOBUS_GASS_OBJECT_TYPE_SECURE_REQUESTATTR_DEFINITION)
++ (&GLOBUS_GASS_OBJECT_TYPE_SECURE_REQUESTATTR_DEFINITION)
+
+ globus_object_t *
+ globus_gass_transfer_secure_requestattr_initialize(
+- globus_object_t * obj,
+- char * proxy_url,
+- globus_size_t block_size,
+- globus_gass_transfer_file_mode_t file_mode,
+- globus_bool_t connection_reuse,
+- int sndbuf,
+- int rcvbuf,
+- globus_bool_t nodelay,
+- globus_gass_transfer_authorization_t authorization,
+- char * subject);
++ globus_object_t * obj,
++ char * proxy_url,
++ globus_size_t block_size,
++ globus_gass_transfer_file_mode_t file_mode,
++ globus_bool_t connection_reuse,
++ int sndbuf,
++ int rcvbuf,
++ globus_bool_t nodelay,
++ globus_gass_transfer_authorization_t authorization,
++ char * subject);
+
+ /* Listener Attribute Object Types */
+ extern const globus_object_type_t
+ GLOBUS_GASS_OBJECT_TYPE_LISTENERATTR_DEFINITION;
+
+ #define GLOBUS_GASS_OBJECT_TYPE_LISTENERATTR \
+- (&GLOBUS_GASS_OBJECT_TYPE_LISTENERATTR_DEFINITION)
++ (&GLOBUS_GASS_OBJECT_TYPE_LISTENERATTR_DEFINITION)
+
+ globus_object_t *
+ globus_gass_transfer_listenerattr_initialize(
+- globus_object_t * obj,
+- int backlog,
+- unsigned short port);
++ globus_object_t * obj,
++ int backlog,
++ unsigned short port);
+
+ #ifdef __cplusplus
+ }
+diff --git a/gass/transfer/source/library/globus_gass_transfer_http.c b/gass/transfer/source/library/globus_gass_transfer_http.c
+index 9cf0b17d1..c7d989c5f 100644
+--- a/gass/transfer/source/library/globus_gass_transfer_http.c
++++ b/gass/transfer/source/library/globus_gass_transfer_http.c
+@@ -43,7 +43,7 @@
+
+ typedef struct
+ {
+- globus_gass_transfer_http_listener_proto_t * l_proto;
++ globus_gass_transfer_http_listener_proto_t * l_proto;
+ globus_gass_transfer_request_t request;
+ }
+ globus_l_gass_transfer_failed_kickout_closure_t;
+@@ -69,23 +69,23 @@ static int globus_l_gass_lock_line=0;
+ static int globus_l_gass_lock_tmp=0;
+ #define MYNAME(x) static char * myname=#x
+ #define globus_l_gass_transfer_http_lock() \
+- printf(strchr(globus_l_gass_transfer_http_debug_level,'9') ? "Thread [%d] acquiring mutex at %s:%d\n" : "", \
++ printf(strchr(globus_l_gass_transfer_http_debug_level,'9') ? "Thread [%d] acquiring mutex at %s:%d\n" : "", \
+ (int) globus_thread_self(), \
+- __FILE__, \
+- __LINE__), \
+- fflush(stdout), \
+- globus_l_gass_lock_tmp = \
+- globus_mutex_lock(&globus_l_gass_transfer_http_mutex), \
+- globus_l_gass_lock_line=__LINE__, \
+- globus_l_gass_lock_tmp
++ __FILE__, \
++ __LINE__), \
++ fflush(stdout), \
++ globus_l_gass_lock_tmp = \
++ globus_mutex_lock(&globus_l_gass_transfer_http_mutex), \
++ globus_l_gass_lock_line=__LINE__, \
++ globus_l_gass_lock_tmp
+ #define globus_l_gass_transfer_http_unlock() \
+ printf(strchr(globus_l_gass_transfer_http_debug_level, '9') ? "Thread [%d] releasing mutex at %s:%d\n" : "", \
+ (int) globus_thread_self(), \
+- __FILE__, \
+- __LINE__), \
+- fflush(stdout), \
+- globus_l_gass_lock_line = 0, \
+- globus_mutex_unlock(&globus_l_gass_transfer_http_mutex)
++ __FILE__, \
++ __LINE__), \
++ fflush(stdout), \
++ globus_l_gass_lock_line = 0, \
++ globus_mutex_unlock(&globus_l_gass_transfer_http_mutex)
+ #else
+ #define debug_printf(level, fmt)
+ #define MYNAME(x)
+@@ -101,14 +101,14 @@ static volatile int globus_l_gass_transfer_http_closing;
+ int
+ globus_l_gass_transfer_http_activate(void)
+ {
+- OM_uint32 maj_stat;
+- OM_uint32 min_stat;
+- gss_name_t name;
+- gss_cred_id_t globus_l_gass_transfer_http_credential =
++ OM_uint32 maj_stat;
++ OM_uint32 min_stat;
++ gss_name_t name;
++ gss_cred_id_t globus_l_gass_transfer_http_credential =
+ GSS_C_NO_CREDENTIAL;
+- gss_buffer_desc name_buffer;
++ gss_buffer_desc name_buffer;
+ MYNAME(globus_l_gass_transfer_http_activate);
+-
++
+ globus_l_gass_transfer_http_closing = 0;
+ name_buffer.value = GLOBUS_NULL;
+ name_buffer.length = 0;
+@@ -116,66 +116,66 @@ globus_l_gass_transfer_http_activate(void)
+ # if defined(DEBUG_GASS_TRANSFER)
+ {
+ globus_l_gass_transfer_http_debug_level =
+- globus_module_getenv("GLOBUS_GASS_TRANSFER_HTTP_DEBUG_LEVEL");
++ globus_module_getenv("GLOBUS_GASS_TRANSFER_HTTP_DEBUG_LEVEL");
+
+- if(globus_l_gass_transfer_http_debug_level == GLOBUS_NULL)
+- {
+- globus_l_gass_transfer_http_debug_level = "";
+- }
++ if(globus_l_gass_transfer_http_debug_level == GLOBUS_NULL)
++ {
++ globus_l_gass_transfer_http_debug_level = "";
++ }
+ }
+ # endif
+-
++
+ debug_printf(1, (_GTSL("Entering %s()\n"),myname));
+ globus_module_activate(GLOBUS_COMMON_MODULE);
+ globus_module_activate(GLOBUS_GSI_GSS_ASSIST_MODULE);
+ globus_module_activate(GLOBUS_IO_MODULE);
+
+ globus_mutex_init(&globus_l_gass_transfer_http_mutex,
+- GLOBUS_NULL);
++ GLOBUS_NULL);
+ globus_cond_init(&globus_l_gass_transfer_http_cond,
+- GLOBUS_NULL);
++ GLOBUS_NULL);
+
+ maj_stat = globus_gss_assist_acquire_cred(
+- &min_stat,
+- GSS_C_BOTH,
+- &globus_l_gass_transfer_http_credential);
++ &min_stat,
++ GSS_C_BOTH,
++ &globus_l_gass_transfer_http_credential);
+
+ if (maj_stat != GSS_S_COMPLETE)
+ {
+- goto error_exit;
++ goto error_exit;
+ }
+
+ maj_stat = gss_inquire_cred(
+- &min_stat,
+- globus_l_gass_transfer_http_credential,
+- &name,
+- GLOBUS_NULL,
+- GLOBUS_NULL,
+- GLOBUS_NULL);
++ &min_stat,
++ globus_l_gass_transfer_http_credential,
++ &name,
++ GLOBUS_NULL,
++ GLOBUS_NULL,
++ GLOBUS_NULL);
+
+ if (maj_stat != GSS_S_COMPLETE)
+ {
+- goto error_exit;
++ goto error_exit;
+ }
+
+ maj_stat = gss_display_name(
+- &min_stat,
+- name,
+- &name_buffer,
+- GLOBUS_NULL);
++ &min_stat,
++ name,
++ &name_buffer,
++ GLOBUS_NULL);
+
+ if (maj_stat != GSS_S_COMPLETE)
+ {
+- goto error_exit;
++ goto error_exit;
+ }
+ maj_stat = gss_release_name(
+- &min_stat,
+- &name);
++ &min_stat,
++ &name);
+ if (maj_stat != GSS_S_COMPLETE)
+ {
+- goto error_exit;
++ goto error_exit;
+ }
+-
++
+ globus_l_gass_transfer_http_subject_name = name_buffer.value;
+
+ if (globus_l_gass_transfer_http_credential != GSS_C_NO_CREDENTIAL)
+@@ -184,7 +184,7 @@ globus_l_gass_transfer_http_activate(void)
+ }
+
+ debug_printf(1, (_GTSL("Exiting %s()\n"),myname));
+-
++
+ return GLOBUS_SUCCESS;
+
+ error_exit:
+@@ -207,7 +207,7 @@ globus_l_gass_transfer_http_deactivate(void)
+ globus_l_gass_transfer_http_lock();
+ while(globus_l_gass_transfer_http_closing > 0)
+ {
+- globus_l_gass_transfer_http_wait();
++ globus_l_gass_transfer_http_wait();
+ }
+ globus_l_gass_transfer_http_unlock();
+ globus_module_deactivate(GLOBUS_IO_MODULE);
+@@ -263,27 +263,27 @@ globus_i_gass_transfer_https_descriptor =
+
+ /*
+ * Function: globus_l_gass_transfer_http_send()
+- *
++ *
+ * Description: Send a byte array to an HTTP server
+- *
+- * Parameters:
+- *
+- * Returns:
++ *
++ * Parameters:
++ *
++ * Returns:
+ */
+ static
+ void
+ globus_l_gass_transfer_http_send(
+- globus_gass_transfer_request_proto_t * proto,
+- globus_gass_transfer_request_t request,
+- globus_byte_t * buffer,
+- globus_size_t buffer_length,
+- globus_bool_t last_data)
++ globus_gass_transfer_request_proto_t * proto,
++ globus_gass_transfer_request_t request,
++ globus_byte_t * buffer,
++ globus_size_t buffer_length,
++ globus_bool_t last_data)
+ {
+- globus_result_t result;
+- globus_gass_transfer_http_request_proto_t * new_proto;
++ globus_result_t result;
++ globus_gass_transfer_http_request_proto_t * new_proto;
+ globus_reltime_t delay_time;
+ MYNAME(globus_l_gass_transfer_http_send);
+-
++
+ debug_printf(1, (_GTSL("Entering %s()\n"),myname));
+ globus_l_gass_transfer_http_lock();
+ new_proto = (globus_gass_transfer_http_request_proto_t *) proto;
+@@ -304,77 +304,77 @@ globus_l_gass_transfer_http_send(
+ */
+ if(new_proto->failure_occurred)
+ {
+- goto fail_exit;
++ goto fail_exit;
+ }
+
+ /* Register the send of the data */
+ if(new_proto->chunked)
+ {
+- globus_size_t num_iovecs;
+-
+- /* send chunk header and footer as an iovec array */
+- sprintf((char *) new_proto->iov[0].iov_base,
+- "%zx%s",
+- new_proto->user_buflen,
+- CRLF);
+- new_proto->iov[0].iov_len = strlen((char *) new_proto->iov[0].iov_base);
+-
+- new_proto->iov[1].iov_base = (void *) new_proto->user_buffer;
+- new_proto->iov[1].iov_len = new_proto->user_buflen;
+-
+- new_proto->iov[2].iov_base = CRLF;
+- new_proto->iov[2].iov_len = 2;
+-
+- if(last_data && new_proto->user_buflen != 0)
+- {
+- /* last data, need to append a zero-length chunk to
+- * indicate this
+- */
+- num_iovecs = 4;
+- }
+- else if(last_data && new_proto->user_buflen == 0)
+- {
+- /* last data, with a zero-length chunk from the user */
+- new_proto->iov[1].iov_base = CRLF;
+- new_proto->iov[1].iov_len = 2;
+- num_iovecs = 2;
+- }
+- else
+- {
+- /* normal chunk */
+- num_iovecs = 3;
+- }
+-
+- debug_printf(4, (_GTSL("%s(): Registering writev\n"), myname));
+- result = globus_io_register_writev(
+- &new_proto->handle,
+- new_proto->iov,
+- num_iovecs /* 3 iovecs header, body, final CRLF */,
+- globus_l_gass_transfer_http_writev_callback,
+- new_proto);
++ globus_size_t num_iovecs;
++
++ /* send chunk header and footer as an iovec array */
++ sprintf((char *) new_proto->iov[0].iov_base,
++ "%zx%s",
++ new_proto->user_buflen,
++ CRLF);
++ new_proto->iov[0].iov_len = strlen((char *) new_proto->iov[0].iov_base);
++
++ new_proto->iov[1].iov_base = (void *) new_proto->user_buffer;
++ new_proto->iov[1].iov_len = new_proto->user_buflen;
++
++ new_proto->iov[2].iov_base = CRLF;
++ new_proto->iov[2].iov_len = 2;
++
++ if(last_data && new_proto->user_buflen != 0)
++ {
++ /* last data, need to append a zero-length chunk to
++ * indicate this
++ */
++ num_iovecs = 4;
++ }
++ else if(last_data && new_proto->user_buflen == 0)
++ {
++ /* last data, with a zero-length chunk from the user */
++ new_proto->iov[1].iov_base = CRLF;
++ new_proto->iov[1].iov_len = 2;
++ num_iovecs = 2;
++ }
++ else
++ {
++ /* normal chunk */
++ num_iovecs = 3;
++ }
++
++ debug_printf(4, (_GTSL("%s(): Registering writev\n"), myname));
++ result = globus_io_register_writev(
++ &new_proto->handle,
++ new_proto->iov,
++ num_iovecs /* 3 iovecs header, body, final CRLF */,
++ globus_l_gass_transfer_http_writev_callback,
++ new_proto);
+ }
+ else
+ {
+- /* send data raw */
+- debug_printf(4, (_GTSL("%s(): Registering writev\n"), myname));
+- result = globus_io_register_write(
+- &new_proto->handle,
+- new_proto->user_buffer,
+- new_proto->user_buflen,
+- globus_l_gass_transfer_http_write_callback,
+- new_proto);
++ /* send data raw */
++ debug_printf(4, (_GTSL("%s(): Registering writev\n"), myname));
++ result = globus_io_register_write(
++ &new_proto->handle,
++ new_proto->user_buffer,
++ new_proto->user_buflen,
++ globus_l_gass_transfer_http_write_callback,
++ new_proto);
+ }
+
+ if(result == GLOBUS_SUCCESS)
+ {
+- /*
+- * Registration succeeded. Callback to GASS occurs when I/O
+- * completes.
+- */
+- globus_l_gass_transfer_http_unlock();
++ /*
++ * Registration succeeded. Callback to GASS occurs when I/O
++ * completes.
++ */
++ globus_l_gass_transfer_http_unlock();
+
+- debug_printf(1, (_GTSL("exiting %s()\n"),myname));
+- return;
++ debug_printf(1, (_GTSL("exiting %s()\n"),myname));
++ return;
+ }
+
+ fail_exit:
+@@ -391,9 +391,9 @@ globus_l_gass_transfer_http_send(
+ debug_printf(4, (_GTSL("%s(): Registering oneshot\n"), myname));
+ globus_callback_register_oneshot(
+ GLOBUS_NULL,
+- &delay_time,
+- globus_l_gass_transfer_http_callback_send_callback,
+- (void *) new_proto);
++ &delay_time,
++ globus_l_gass_transfer_http_callback_send_callback,
++ (void *) new_proto);
+
+ globus_l_gass_transfer_http_unlock();
+ debug_printf(1, (_GTSL("exiting %s()\n"),myname));
+@@ -403,29 +403,29 @@ globus_l_gass_transfer_http_send(
+
+ /*
+ * Function: globus_l_gass_transfer_http_receive()
+- *
++ *
+ * Description: Schedule the next block of data from the http server
+ * to end up in the provided byte array
+- *
+- * Parameters:
+- *
+- * Returns:
++ *
++ * Parameters:
++ *
++ * Returns:
+ */
+ static
+ void
+ globus_l_gass_transfer_http_receive(
+- globus_gass_transfer_request_proto_t * proto,
+- globus_gass_transfer_request_t request,
+- globus_byte_t * buffer,
+- globus_size_t buffer_length,
+- globus_size_t wait_for_length)
++ globus_gass_transfer_request_proto_t * proto,
++ globus_gass_transfer_request_t request,
++ globus_byte_t * buffer,
++ globus_size_t buffer_length,
++ globus_size_t wait_for_length)
+ {
+- globus_gass_transfer_http_request_proto_t * new_proto;
++ globus_gass_transfer_http_request_proto_t * new_proto;
+ globus_reltime_t delay_time;
+ MYNAME(globus_l_gass_transfer_http_receive);
+-
++
+ debug_printf(1, (_GTSL("Entering %s()\n"),myname));
+-
++
+ globus_l_gass_transfer_http_lock();
+ new_proto = (globus_gass_transfer_http_request_proto_t *) proto;
+
+@@ -446,9 +446,9 @@ globus_l_gass_transfer_http_receive(
+ debug_printf(4, (_GTSL("%s(): Registering oneshot\n"), myname));
+ globus_callback_register_oneshot(
+ GLOBUS_NULL,
+- &delay_time,
+- globus_l_gass_transfer_http_callback_read_buffered_callback,
+- (void *) new_proto);
++ &delay_time,
++ globus_l_gass_transfer_http_callback_read_buffered_callback,
++ (void *) new_proto);
+
+ globus_l_gass_transfer_http_unlock();
+ debug_printf(1, (_GTSL("exiting %s()\n"),myname));
+@@ -457,21 +457,21 @@ globus_l_gass_transfer_http_receive(
+
+ /*
+ * Function: globus_l_gass_transfer_http_fail()
+- *
++ *
+ * Description: Cause the given request to fail for client-caused reasons
+- *
+- * Parameters:
+- *
+- * Returns:
++ *
++ * Parameters:
++ *
++ * Returns:
+ */
+ static
+ void
+ globus_l_gass_transfer_http_fail(
+- globus_gass_transfer_request_proto_t * proto,
+- globus_gass_transfer_request_t request)
++ globus_gass_transfer_request_proto_t * proto,
++ globus_gass_transfer_request_t request)
+ {
+- globus_gass_transfer_http_request_proto_t * new_proto;
+- globus_bool_t signalled;
++ globus_gass_transfer_http_request_proto_t * new_proto;
++ globus_bool_t signalled;
+ globus_result_t result;
+ MYNAME(globus_l_gass_transfer_http_fail);
+
+@@ -484,42 +484,42 @@ globus_l_gass_transfer_http_fail(
+ signalled = GLOBUS_FALSE;
+ while(!signalled)
+ {
+- switch(new_proto->state)
+- {
+- case GLOBUS_GASS_TRANSFER_HTTP_STATE_PENDING:
+- if(new_proto->oneshot_registered == GLOBUS_TRUE)
+- {
+- new_proto->failure_occurred = GLOBUS_TRUE;
+- signalled = GLOBUS_TRUE;
+-
+- break;
+- }
+- else if(new_proto->oneshot_active)
+- {
+- new_proto->failure_occurred = GLOBUS_TRUE;
+- while(new_proto->state ==
+- GLOBUS_GASS_TRANSFER_HTTP_STATE_PENDING)
+- {
+- globus_l_gass_transfer_http_wait();
+- }
+- break;
+- }
++ switch(new_proto->state)
++ {
++ case GLOBUS_GASS_TRANSFER_HTTP_STATE_PENDING:
++ if(new_proto->oneshot_registered == GLOBUS_TRUE)
++ {
++ new_proto->failure_occurred = GLOBUS_TRUE;
++ signalled = GLOBUS_TRUE;
++
++ break;
++ }
++ else if(new_proto->oneshot_active)
++ {
++ new_proto->failure_occurred = GLOBUS_TRUE;
++ while(new_proto->state ==
++ GLOBUS_GASS_TRANSFER_HTTP_STATE_PENDING)
++ {
++ globus_l_gass_transfer_http_wait();
++ }
++ break;
++ }
+ case GLOBUS_GASS_TRANSFER_HTTP_STATE_CONNECTING:
+ case GLOBUS_GASS_TRANSFER_HTTP_STATE_IDLE:
+- /* We will transition to the closing state, signalling the failure,
+- * and registering the close (which will transition us to the
+- * done state).
+- */
+- signalled = GLOBUS_TRUE;
+- new_proto->failure_occurred = GLOBUS_TRUE;
++ /* We will transition to the closing state, signalling the failure,
++ * and registering the close (which will transition us to the
++ * done state).
++ */
++ signalled = GLOBUS_TRUE;
++ new_proto->failure_occurred = GLOBUS_TRUE;
+
+- result = globus_l_gass_transfer_http_register_close(new_proto);
++ result = globus_l_gass_transfer_http_register_close(new_proto);
+
+ if (result != GLOBUS_SUCCESS)
+ {
+ globus_l_gass_transfer_http_close(new_proto);
+ }
+- break;
++ break;
+
+ case GLOBUS_GASS_TRANSFER_HTTP_STATE_CLOSING:
+ case GLOBUS_GASS_TRANSFER_HTTP_STATE_DONE:
+@@ -527,9 +527,9 @@ globus_l_gass_transfer_http_fail(
+ case GLOBUS_GASS_TRANSFER_HTTP_STATE_RESPONDING:
+ case GLOBUS_GASS_TRANSFER_HTTP_STATE_REFERRED:
+ case GLOBUS_GASS_TRANSFER_HTTP_STATE_DENIED:
+- signalled = GLOBUS_TRUE;
+- new_proto->failure_occurred = GLOBUS_TRUE;
+- break;
++ signalled = GLOBUS_TRUE;
++ new_proto->failure_occurred = GLOBUS_TRUE;
++ break;
+ }
+ }
+ globus_l_gass_transfer_http_unlock();
+@@ -540,13 +540,13 @@ globus_l_gass_transfer_http_fail(
+ static
+ void
+ globus_l_gass_transfer_http_write_callback(
+- void * callback_arg,
+- globus_io_handle_t * handle,
+- globus_result_t result,
+- globus_byte_t * buf,
+- globus_size_t nbytes)
++ void * callback_arg,
++ globus_io_handle_t * handle,
++ globus_result_t result,
++ globus_byte_t * buf,
++ globus_size_t nbytes)
+ {
+- globus_gass_transfer_http_request_proto_t * proto;
++ globus_gass_transfer_http_request_proto_t * proto;
+ MYNAME(globus_l_gass_transfer_http_write_callback);
+
+ debug_printf(3, (_GTSL("Entering %s()\n"),myname));
+@@ -555,113 +555,113 @@ globus_l_gass_transfer_http_write_callback(
+ globus_l_gass_transfer_http_lock();
+
+ if(result != GLOBUS_SUCCESS ||
+- proto->failure_occurred ||
+- proto->parse_error)
++ proto->failure_occurred ||
++ proto->parse_error)
+ {
+- proto->last_data = GLOBUS_TRUE;
++ proto->last_data = GLOBUS_TRUE;
+ }
+
+ if(proto->last_data)
+ {
+- proto->user_offset = nbytes;
+- if((proto->type == GLOBUS_GASS_TRANSFER_REQUEST_TYPE_PUT ||
+- proto->type == GLOBUS_GASS_TRANSFER_REQUEST_TYPE_APPEND) &&
+- (!proto->failure_occurred && !proto->parse_error))
+- {
+- if(proto->got_response)
+- {
+- globus_byte_t * buffer;
+- globus_size_t offset;
+- globus_gass_transfer_request_t request = proto->request;
++ proto->user_offset = nbytes;
++ if((proto->type == GLOBUS_GASS_TRANSFER_REQUEST_TYPE_PUT ||
++ proto->type == GLOBUS_GASS_TRANSFER_REQUEST_TYPE_APPEND) &&
++ (!proto->failure_occurred && !proto->parse_error))
++ {
++ if(proto->got_response)
++ {
++ globus_byte_t * buffer;
++ globus_size_t offset;
++ globus_gass_transfer_request_t request = proto->request;
+
+- int failed = proto->failure_occurred;
++ int failed = proto->failure_occurred;
+
+- proto->failure_occurred = GLOBUS_TRUE;
+- buffer = proto->user_buffer;
+- offset = proto->user_offset;
++ proto->failure_occurred = GLOBUS_TRUE;
++ buffer = proto->user_buffer;
++ offset = proto->user_offset;
+
+- result = globus_l_gass_transfer_http_register_close(proto);
++ result = globus_l_gass_transfer_http_register_close(proto);
+ if (result != GLOBUS_SUCCESS)
+ {
+ globus_l_gass_transfer_http_close(proto);
+ }
+
+- globus_l_gass_transfer_http_unlock();
+- globus_gass_transfer_proto_send_complete(request,
+- buffer,
+- offset,
+- failed,
+- GLOBUS_TRUE);
+- debug_printf(3, (_GTSL("Exiting %s()\n"),myname));
+- return;
+- }
+- else
+- {
+- /* the callback to read the response is registered at
+- * the beginning of the send, so we do nothing here,
+- * and wait for the response
+- */
+- proto->waiting_for_response = GLOBUS_TRUE;
+- globus_l_gass_transfer_http_unlock();
+-
+- debug_printf(3, (_GTSL("Exiting %s()\n"),myname));
+- return;
+- }
+- }
+- else
+- {
+- globus_gass_transfer_request_t request;
+- globus_byte_t * buf;
+- globus_size_t nbytes_sent;
+- globus_bool_t fail;
+-
+- request = proto->request;
+- buf = proto->user_buffer;
+- nbytes_sent = proto->user_offset;
+- fail = proto->failure_occurred;
+-
+-
+- /* need to register the close, and callback to the user */
+- result = globus_l_gass_transfer_http_register_close(proto);
++ globus_l_gass_transfer_http_unlock();
++ globus_gass_transfer_proto_send_complete(request,
++ buffer,
++ offset,
++ failed,
++ GLOBUS_TRUE);
++ debug_printf(3, (_GTSL("Exiting %s()\n"),myname));
++ return;
++ }
++ else
++ {
++ /* the callback to read the response is registered at
++ * the beginning of the send, so we do nothing here,
++ * and wait for the response
++ */
++ proto->waiting_for_response = GLOBUS_TRUE;
++ globus_l_gass_transfer_http_unlock();
++
++ debug_printf(3, (_GTSL("Exiting %s()\n"),myname));
++ return;
++ }
++ }
++ else
++ {
++ globus_gass_transfer_request_t request;
++ globus_byte_t * buf;
++ globus_size_t nbytes_sent;
++ globus_bool_t fail;
++
++ request = proto->request;
++ buf = proto->user_buffer;
++ nbytes_sent = proto->user_offset;
++ fail = proto->failure_occurred;
++
++
++ /* need to register the close, and callback to the user */
++ result = globus_l_gass_transfer_http_register_close(proto);
+ if (result != GLOBUS_SUCCESS)
+ {
+ globus_l_gass_transfer_http_close(proto);
+ }
+-
+- globus_l_gass_transfer_http_unlock();
+
+- globus_gass_transfer_proto_send_complete(
+- request,
+- buf,
+- nbytes_sent,
+- fail,
+- GLOBUS_TRUE);
+- debug_printf(3, (_GTSL("Exiting %s()\n"),myname));
++ globus_l_gass_transfer_http_unlock();
++
++ globus_gass_transfer_proto_send_complete(
++ request,
++ buf,
++ nbytes_sent,
++ fail,
++ GLOBUS_TRUE);
++ debug_printf(3, (_GTSL("Exiting %s()\n"),myname));
+
+- return;
+- }
++ return;
++ }
+ }
+ else
+ {
+- globus_gass_transfer_request_t request;
+- globus_byte_t * buf;
+- globus_bool_t fail;
+- globus_bool_t last_data;
+-
+- proto->state = GLOBUS_GASS_TRANSFER_HTTP_STATE_IDLE;
+-
+- request = proto->request;
+- buf = proto->user_buffer;
+- fail = proto->failure_occurred;
+- last_data = proto->last_data;
+-
+-
+- globus_l_gass_transfer_http_unlock();
+- globus_gass_transfer_proto_send_complete(request,
+- buf,
+- nbytes,
+- fail,
+- last_data);
++ globus_gass_transfer_request_t request;
++ globus_byte_t * buf;
++ globus_bool_t fail;
++ globus_bool_t last_data;
++
++ proto->state = GLOBUS_GASS_TRANSFER_HTTP_STATE_IDLE;
++
++ request = proto->request;
++ buf = proto->user_buffer;
++ fail = proto->failure_occurred;
++ last_data = proto->last_data;
++
++
++ globus_l_gass_transfer_http_unlock();
++ globus_gass_transfer_proto_send_complete(request,
++ buf,
++ nbytes,
++ fail,
++ last_data);
+ }
+ debug_printf(3, (_GTSL("Exiting %s()\n"),myname));
+ return;
+@@ -671,14 +671,14 @@ globus_l_gass_transfer_http_write_callback(
+ static
+ void
+ globus_l_gass_transfer_http_writev_callback(
+- void * callback_arg,
+- globus_io_handle_t * handle,
+- globus_result_t result,
+- struct iovec * iov,
+- globus_size_t iovcnt,
+- globus_size_t nbytes)
++ void * callback_arg,
++ globus_io_handle_t * handle,
++ globus_result_t result,
++ struct iovec * iov,
++ globus_size_t iovcnt,
++ globus_size_t nbytes)
+ {
+- globus_gass_transfer_http_request_proto_t * proto;
++ globus_gass_transfer_http_request_proto_t * proto;
+ MYNAME(globus_l_gass_transfer_http_writev_callback);
+
+ debug_printf(3, (_GTSL("Entering %s()\n"),myname));
+@@ -687,132 +687,132 @@ globus_l_gass_transfer_http_writev_callback(
+ globus_l_gass_transfer_http_lock();
+
+ if(result != GLOBUS_SUCCESS ||
+- proto->failure_occurred ||
+- proto->parse_error)
++ proto->failure_occurred ||
++ proto->parse_error)
+ {
+- proto->last_data = GLOBUS_TRUE;
++ proto->last_data = GLOBUS_TRUE;
+ }
+
+ if(proto->last_data)
+ {
+- proto->user_offset = nbytes - iov[0].iov_len - iov[2].iov_len;
++ proto->user_offset = nbytes - iov[0].iov_len - iov[2].iov_len;
+
+- if((proto->type == GLOBUS_GASS_TRANSFER_REQUEST_TYPE_PUT ||
+- proto->type == GLOBUS_GASS_TRANSFER_REQUEST_TYPE_APPEND) &&
+- (!proto->failure_occurred && !proto->parse_error))
+- {
+- if(proto->got_response)
+- {
+- globus_byte_t * buffer;
+- globus_size_t offset;
+- int failed = proto->failure_occurred;
+- globus_gass_transfer_request_t request = proto->request;
++ if((proto->type == GLOBUS_GASS_TRANSFER_REQUEST_TYPE_PUT ||
++ proto->type == GLOBUS_GASS_TRANSFER_REQUEST_TYPE_APPEND) &&
++ (!proto->failure_occurred && !proto->parse_error))
++ {
++ if(proto->got_response)
++ {
++ globus_byte_t * buffer;
++ globus_size_t offset;
++ int failed = proto->failure_occurred;
++ globus_gass_transfer_request_t request = proto->request;
+
+- buffer = proto->user_buffer;
+- offset = proto->user_offset;
++ buffer = proto->user_buffer;
++ offset = proto->user_offset;
+
+- result = globus_l_gass_transfer_http_register_close(proto);
++ result = globus_l_gass_transfer_http_register_close(proto);
+ if (result != GLOBUS_SUCCESS)
+ {
+ globus_l_gass_transfer_http_close(proto);
+ }
+
+- globus_l_gass_transfer_http_unlock();
+- globus_gass_transfer_proto_send_complete(request,
+- buffer,
+- offset,
+- failed,
+- GLOBUS_TRUE);
+- debug_printf(3, (_GTSL("Exiting %s()\n"),myname));
+- return;
+- }
+- else
+- {
+- /* the callback to read the response is registered at
+- * the beginning of the send, so we do nothing here,
+- * and wait for the response
+- */
+- proto->waiting_for_response = GLOBUS_TRUE;
+- globus_l_gass_transfer_http_unlock();
+-
+- debug_printf(3, (_GTSL("Exiting %s()\n"),myname));
+- return;
+- }
+- }
+- else
+- {
+- globus_gass_transfer_request_t request;
+- globus_byte_t *buf;
+- globus_size_t nbytes_sent;
+- globus_bool_t fail;
+-
+- request = proto->request;
+- buf = proto->user_buffer;
+- nbytes_sent = proto->user_offset;
+- fail = proto->failure_occurred;
+-
+- /* need to register the close, and callback to the user */
+- result = globus_l_gass_transfer_http_register_close(proto);
++ globus_l_gass_transfer_http_unlock();
++ globus_gass_transfer_proto_send_complete(request,
++ buffer,
++ offset,
++ failed,
++ GLOBUS_TRUE);
++ debug_printf(3, (_GTSL("Exiting %s()\n"),myname));
++ return;
++ }
++ else
++ {
++ /* the callback to read the response is registered at
++ * the beginning of the send, so we do nothing here,
++ * and wait for the response
++ */
++ proto->waiting_for_response = GLOBUS_TRUE;
++ globus_l_gass_transfer_http_unlock();
++
++ debug_printf(3, (_GTSL("Exiting %s()\n"),myname));
++ return;
++ }
++ }
++ else
++ {
++ globus_gass_transfer_request_t request;
++ globus_byte_t *buf;
++ globus_size_t nbytes_sent;
++ globus_bool_t fail;
++
++ request = proto->request;
++ buf = proto->user_buffer;
++ nbytes_sent = proto->user_offset;
++ fail = proto->failure_occurred;
++
++ /* need to register the close, and callback to the user */
++ result = globus_l_gass_transfer_http_register_close(proto);
+ if (result != GLOBUS_SUCCESS)
+ {
+ globus_l_gass_transfer_http_close(proto);
+ }
+
+- globus_l_gass_transfer_http_unlock();
+- globus_gass_transfer_proto_send_complete(
+- request,
+- buf,
+- nbytes_sent,
+- fail,
+- GLOBUS_TRUE);
+- debug_printf(3, (_GTSL("Exiting %s()\n"),myname));
+- return;
+- }
++ globus_l_gass_transfer_http_unlock();
++ globus_gass_transfer_proto_send_complete(
++ request,
++ buf,
++ nbytes_sent,
++ fail,
++ GLOBUS_TRUE);
++ debug_printf(3, (_GTSL("Exiting %s()\n"),myname));
++ return;
++ }
+ }
+ else
+ {
+- globus_gass_transfer_request_t request;
+- globus_byte_t *buf;
+- globus_size_t nbytes_sent;
+- globus_bool_t fail;
+-
+- request = proto->request;
+- buf = proto->user_buffer;
+- nbytes_sent = nbytes - iov[0].iov_len - iov[2].iov_len,
+- fail = proto->failure_occurred;
+-
+- proto->state = GLOBUS_GASS_TRANSFER_HTTP_STATE_IDLE;
+-
+- globus_l_gass_transfer_http_unlock();
+- globus_gass_transfer_proto_send_complete(request,
+- buf,
+- nbytes_sent,
+- fail,
+- GLOBUS_FALSE);
+- debug_printf(3, (_GTSL("Exiting %s()\n"),myname));
+- return;
++ globus_gass_transfer_request_t request;
++ globus_byte_t *buf;
++ globus_size_t nbytes_sent;
++ globus_bool_t fail;
++
++ request = proto->request;
++ buf = proto->user_buffer;
++ nbytes_sent = nbytes - iov[0].iov_len - iov[2].iov_len,
++ fail = proto->failure_occurred;
++
++ proto->state = GLOBUS_GASS_TRANSFER_HTTP_STATE_IDLE;
++
++ globus_l_gass_transfer_http_unlock();
++ globus_gass_transfer_proto_send_complete(request,
++ buf,
++ nbytes_sent,
++ fail,
++ GLOBUS_FALSE);
++ debug_printf(3, (_GTSL("Exiting %s()\n"),myname));
++ return;
+ }
+ }
+ /* globus_l_gass_transfer_http_writev_callback() */
+
+ /*
+ * Function: globus_l_gass_transfer_http_read_callack()
+- *
++ *
+ * Description: Callback when the read of from the connection to the active
+ * buffer has completed or failed.
+- *
+- * Parameters:
+- *
+- * Returns:
++ *
++ * Parameters:
++ *
++ * Returns:
+ */
+ static
+ void
+ globus_l_gass_transfer_http_read_callback(
+- void * callback_arg,
+- globus_io_handle_t * handle,
+- globus_result_t result,
+- globus_byte_t * buf,
+- globus_size_t nbytes)
++ void * callback_arg,
++ globus_io_handle_t * handle,
++ globus_result_t result,
++ globus_byte_t * buf,
++ globus_size_t nbytes)
+ {
+ globus_object_t * err = GLOBUS_NULL;
+ globus_gass_transfer_http_request_proto_t * proto;
+@@ -820,21 +820,21 @@ globus_l_gass_transfer_http_read_callback(
+ globus_bool_t last_data = GLOBUS_FALSE;
+ globus_bool_t failure = GLOBUS_FALSE;
+ globus_size_t offset = 0;
+-
++
+ MYNAME(globus_l_gass_transfer_http_read_callback);
+-
++
+ debug_printf(3, (_GTSL("Entering %s()\n"),myname));
+-
++
+ proto = (globus_gass_transfer_http_request_proto_t *) callback_arg;
+
+ if(result != GLOBUS_SUCCESS)
+ {
+ char * tmpstr;
+
+- err = globus_error_get(result);
+- tmpstr = globus_object_printable_to_string(err);
+- debug_printf(5, (_GTSL("%s(): Error: %s\n"), myname, tmpstr));
+- globus_libc_free(tmpstr);
++ err = globus_error_get(result);
++ tmpstr = globus_object_printable_to_string(err);
++ debug_printf(5, (_GTSL("%s(): Error: %s\n"), myname, tmpstr));
++ globus_libc_free(tmpstr);
+ }
+
+ globus_l_gass_transfer_http_lock();
+@@ -843,111 +843,111 @@ globus_l_gass_transfer_http_read_callback(
+ proto->handled += nbytes;
+ if(nbytes > proto->user_waitlen)
+ {
+- proto->user_waitlen = 0;
++ proto->user_waitlen = 0;
+ }
+ else
+ {
+- proto->user_waitlen -= nbytes;
++ proto->user_waitlen -= nbytes;
+ }
+
+ if(proto->chunked)
+ {
+- proto->chunk_left -= nbytes;
++ proto->chunk_left -= nbytes;
+ }
+
+ if(result != GLOBUS_SUCCESS &&
+ globus_io_eof(err))
+ {
+- proto->eof_read = GLOBUS_TRUE;
++ proto->eof_read = GLOBUS_TRUE;
+ }
+ else if(result != GLOBUS_SUCCESS ||
+- proto->failure_occurred ||
+- proto->parse_error)
++ proto->failure_occurred ||
++ proto->parse_error)
+ {
+- proto->recv_state = GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_ERROR;
++ proto->recv_state = GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_ERROR;
+ }
+
+ if(proto->recv_state == GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_UNTIL_EOF &&
+ proto->eof_read == GLOBUS_TRUE)
+ {
+- proto->recv_state = GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_EOF;
++ proto->recv_state = GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_EOF;
+ }
+ else if(proto->recv_state ==
+- GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_UNTIL_LENGTH &&
+- proto->handled == proto->length)
++ GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_UNTIL_LENGTH &&
++ proto->handled == proto->length)
+ {
+- proto->recv_state = GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_EOF;
++ proto->recv_state = GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_EOF;
+ }
+ else if(proto->recv_state ==
+- GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_UNTIL_LENGTH &&
+- proto->eof_read == GLOBUS_TRUE &&
+- proto->handled < proto->length)
++ GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_UNTIL_LENGTH &&
++ proto->eof_read == GLOBUS_TRUE &&
++ proto->handled < proto->length)
+ {
+- proto->recv_state = GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_ERROR;
++ proto->recv_state = GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_ERROR;
+ }
+ else if(nbytes==0 && proto->eof_read)
+ {
+ proto->failure_occurred = GLOBUS_TRUE;
+- proto->recv_state = GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_ERROR;
++ proto->recv_state = GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_ERROR;
+ }
+
+ if((proto->type == GLOBUS_GASS_TRANSFER_REQUEST_TYPE_PUT ||
+ proto->type == GLOBUS_GASS_TRANSFER_REQUEST_TYPE_APPEND) &&
+ proto->recv_state == GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_EOF)
+ {
+- char * response;
+- globus_size_t response_len=0;
+- globus_size_t offset;
+-
+-
+- response_len += 1;
+- response_len += strlen(GLOBUS_L_GENERIC_RESPONSE);
+- response_len += 3;
+- response_len += strlen(GLOBUS_L_OK);
+- response_len += 2;
+- response = globus_malloc(response_len);
+-
+- proto->state = GLOBUS_GASS_TRANSFER_HTTP_STATE_RESPONDING;
+- offset = sprintf(response,
+- GLOBUS_L_GENERIC_RESPONSE,
+- 0,
+- 200,
+- GLOBUS_L_OK);
+- offset += sprintf(response + offset,
+- CRLF);
+-
+- debug_printf(4,(_GTSL("%s(): Registering write\n"),myname));
+- globus_io_register_write(&proto->handle,
+- (globus_byte_t *) response,
+- strlen(response),
+- globus_l_gass_transfer_http_write_response,
+- proto);
++ char * response;
++ globus_size_t response_len=0;
++ globus_size_t offset;
++
++
++ response_len += 1;
++ response_len += strlen(GLOBUS_L_GENERIC_RESPONSE);
++ response_len += 3;
++ response_len += strlen(GLOBUS_L_OK);
++ response_len += 2;
++ response = globus_malloc(response_len);
++
++ proto->state = GLOBUS_GASS_TRANSFER_HTTP_STATE_RESPONDING;
++ offset = sprintf(response,
++ GLOBUS_L_GENERIC_RESPONSE,
++ 0,
++ 200,
++ GLOBUS_L_OK);
++ offset += sprintf(response + offset,
++ CRLF);
++
++ debug_printf(4,(_GTSL("%s(): Registering write\n"),myname));
++ globus_io_register_write(&proto->handle,
++ (globus_byte_t *) response,
++ strlen(response),
++ globus_l_gass_transfer_http_write_response,
++ proto);
+ }
+ /* Register the socket for closing if we're done reading from it */
+ else if(proto->recv_state == GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_EOF ||
+ proto->recv_state == GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_ERROR)
+ {
+- failure = proto->failure_occurred;
+- buf = proto->user_buffer;
+- offset = proto->user_offset;
+- request = proto->request;
++ failure = proto->failure_occurred;
++ buf = proto->user_buffer;
++ offset = proto->user_offset;
++ request = proto->request;
+ last_data = GLOBUS_TRUE;
+
+- if(proto->state != GLOBUS_GASS_TRANSFER_HTTP_STATE_CLOSING)
+- {
+- result = globus_l_gass_transfer_http_register_close(proto);
++ if(proto->state != GLOBUS_GASS_TRANSFER_HTTP_STATE_CLOSING)
++ {
++ result = globus_l_gass_transfer_http_register_close(proto);
+ if (result != GLOBUS_SUCCESS)
+ {
+ globus_l_gass_transfer_http_close(proto);
+ }
+- }
+- globus_l_gass_transfer_http_unlock();
+- debug_printf(2, (_GTSL("calling globus_gass_transfer_proto_receive_complete()")));
+- globus_gass_transfer_proto_receive_complete(request,
+- buf,
+- offset,
+- failure,
+- last_data);
++ }
++ globus_l_gass_transfer_http_unlock();
++ debug_printf(2, (_GTSL("calling globus_gass_transfer_proto_receive_complete()")));
++ globus_gass_transfer_proto_receive_complete(request,
++ buf,
++ offset,
++ failure,
++ last_data);
+ goto out;
+ }
+
+@@ -955,44 +955,44 @@ globus_l_gass_transfer_http_read_callback(
+ proto->recv_state == GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_EOF ||
+ proto->recv_state == GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_ERROR)
+ {
+- /*
+- * Received the required minimum of data from connection, an
+- * error, or the end-of file, signal this to GASS
+- */
+- if(proto->state == GLOBUS_GASS_TRANSFER_HTTP_STATE_PENDING)
+- {
+- proto->state = GLOBUS_GASS_TRANSFER_HTTP_STATE_IDLE;
+- }
+- if(proto->recv_state == GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_EOF ||
+- proto->recv_state == GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_ERROR)
+- {
+- last_data = GLOBUS_TRUE;
+- }
+-
+- failure = proto->failure_occurred;
+- buf = proto->user_buffer;
+- offset = proto->user_offset;
+- request = proto->request;
+-
+- globus_l_gass_transfer_http_unlock();
+- debug_printf(2, (_GTSL("calling globus_gass_transfer_proto_receive_complete()")));
+- globus_gass_transfer_proto_receive_complete(request,
+- buf,
+- offset,
+- failure,
+- last_data);
++ /*
++ * Received the required minimum of data from connection, an
++ * error, or the end-of file, signal this to GASS
++ */
++ if(proto->state == GLOBUS_GASS_TRANSFER_HTTP_STATE_PENDING)
++ {
++ proto->state = GLOBUS_GASS_TRANSFER_HTTP_STATE_IDLE;
++ }
++ if(proto->recv_state == GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_EOF ||
++ proto->recv_state == GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_ERROR)
++ {
++ last_data = GLOBUS_TRUE;
++ }
++
++ failure = proto->failure_occurred;
++ buf = proto->user_buffer;
++ offset = proto->user_offset;
++ request = proto->request;
++
++ globus_l_gass_transfer_http_unlock();
++ debug_printf(2, (_GTSL("calling globus_gass_transfer_proto_receive_complete()")));
++ globus_gass_transfer_proto_receive_complete(request,
++ buf,
++ offset,
++ failure,
++ last_data);
+ }
+ else
+ {
+- result = globus_l_gass_transfer_http_register_read(proto);
++ result = globus_l_gass_transfer_http_register_read(proto);
+
+- globus_l_gass_transfer_http_unlock();
++ globus_l_gass_transfer_http_unlock();
+ }
+
+ out:
+ if(err)
+ {
+- globus_object_free(err);
++ globus_object_free(err);
+ }
+
+ debug_printf(3, (_GTSL("Exiting %s()\n"),myname));
+@@ -1002,25 +1002,25 @@ out:
+
+ /*
+ * Function: globus_l_gass_transfer_http_read_buffered_callack()
+- *
++ *
+ * Description: Callback when the read of from the http to the
+ * response buffer has completed or failed.
+- *
+- * Parameters:
+- *
+- * Returns:
++ *
++ * Parameters:
++ *
++ * Returns:
+ */
+ static
+ void
+ globus_l_gass_transfer_http_read_buffered_callback(
+- void * callback_arg,
+- globus_io_handle_t * handle,
+- globus_result_t result,
+- globus_byte_t * buf,
+- globus_size_t nbytes)
++ void * callback_arg,
++ globus_io_handle_t * handle,
++ globus_result_t result,
++ globus_byte_t * buf,
++ globus_size_t nbytes)
+ {
+- globus_object_t * err = GLOBUS_NULL;
+- globus_gass_transfer_http_request_proto_t * proto;
++ globus_object_t * err = GLOBUS_NULL;
++ globus_gass_transfer_http_request_proto_t * proto;
+ MYNAME(globus_l_gass_transfer_http_read_buffered_callback);
+
+ debug_printf(3, (_GTSL("Entering %s()\n"),myname));
+@@ -1031,10 +1031,10 @@ globus_l_gass_transfer_http_read_buffered_callback(
+ {
+ char * tmpstr;
+
+- err = globus_error_get(result);
+- tmpstr = globus_object_printable_to_string(err);
+- debug_printf(5, (_GTSL("%s(): %s\n"), myname, tmpstr));
+- globus_libc_free(tmpstr);
++ err = globus_error_get(result);
++ tmpstr = globus_object_printable_to_string(err);
++ debug_printf(5, (_GTSL("%s(): %s\n"), myname, tmpstr));
++ globus_libc_free(tmpstr);
+ }
+
+ globus_l_gass_transfer_http_lock();
+@@ -1044,11 +1044,11 @@ globus_l_gass_transfer_http_read_buffered_callback(
+ if(result != GLOBUS_SUCCESS &&
+ globus_io_eof(err))
+ {
+- proto->eof_read = GLOBUS_TRUE;
++ proto->eof_read = GLOBUS_TRUE;
+ }
+ else if(result != GLOBUS_SUCCESS)
+ {
+- proto->recv_state = GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_ERROR;
++ proto->recv_state = GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_ERROR;
+ }
+
+ /*
+@@ -1060,106 +1060,106 @@ globus_l_gass_transfer_http_read_buffered_callback(
+
+ if(proto->failure_occurred)
+ {
+- proto->recv_state = GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_ERROR;
++ proto->recv_state = GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_ERROR;
+ }
+
+ /* successful read for server, send response */
+ if((proto->type == GLOBUS_GASS_TRANSFER_REQUEST_TYPE_PUT ||
+- proto->type == GLOBUS_GASS_TRANSFER_REQUEST_TYPE_APPEND) &&
++ proto->type == GLOBUS_GASS_TRANSFER_REQUEST_TYPE_APPEND) &&
+ proto->recv_state == GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_EOF &&
+ proto->recv_state != GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_ERROR)
+ {
+- char * response;
+- globus_size_t response_len=0;
+- globus_size_t offset;
+-
+-
+- response_len += 1;
+- response_len += strlen(GLOBUS_L_GENERIC_RESPONSE);
+- response_len += 3;
+- response_len += strlen(GLOBUS_L_OK);
+- response_len += 2;
+- response = globus_malloc(response_len);
+-
+- proto->state = GLOBUS_GASS_TRANSFER_HTTP_STATE_RESPONDING;
+- offset = sprintf(response,
+- GLOBUS_L_GENERIC_RESPONSE,
+- 0,
+- 200,
+- GLOBUS_L_OK);
+- offset += sprintf(response + offset,
+- CRLF);
+-
+- debug_printf(4,(_GTSL("%s(): Registering write\n"),myname));
+- globus_io_register_write(&proto->handle,
+- (globus_byte_t *) response,
+- strlen(response),
+- globus_l_gass_transfer_http_write_response,
+- proto);
++ char * response;
++ globus_size_t response_len=0;
++ globus_size_t offset;
++
++
++ response_len += 1;
++ response_len += strlen(GLOBUS_L_GENERIC_RESPONSE);
++ response_len += 3;
++ response_len += strlen(GLOBUS_L_OK);
++ response_len += 2;
++ response = globus_malloc(response_len);
++
++ proto->state = GLOBUS_GASS_TRANSFER_HTTP_STATE_RESPONDING;
++ offset = sprintf(response,
++ GLOBUS_L_GENERIC_RESPONSE,
++ 0,
++ 200,
++ GLOBUS_L_OK);
++ offset += sprintf(response + offset,
++ CRLF);
++
++ debug_printf(4,(_GTSL("%s(): Registering write\n"),myname));
++ globus_io_register_write(&proto->handle,
++ (globus_byte_t *) response,
++ strlen(response),
++ globus_l_gass_transfer_http_write_response,
++ proto);
+ }
+ /* Register the socket for closing if we're done reading from it */
+ else if(proto->recv_state == GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_EOF ||
+- proto->recv_state == GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_ERROR)
++ proto->recv_state == GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_ERROR)
+ {
+- if(proto->state != GLOBUS_GASS_TRANSFER_HTTP_STATE_CLOSING)
+- {
+- result = globus_l_gass_transfer_http_register_close(proto);
++ if(proto->state != GLOBUS_GASS_TRANSFER_HTTP_STATE_CLOSING)
++ {
++ result = globus_l_gass_transfer_http_register_close(proto);
+ if (result != GLOBUS_SUCCESS)
+ {
+ globus_l_gass_transfer_http_close(proto);
+ }
+- }
++ }
+ }
+ if(proto->user_waitlen == 0 ||
+ proto->recv_state == GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_EOF ||
+ proto->recv_state == GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_ERROR)
+ {
+- globus_gass_transfer_request_t request;
+- globus_bool_t last_data = GLOBUS_FALSE;
+- globus_bool_t failure ;
+- globus_byte_t * buf;
+- globus_size_t offset;
+- /*
+- * Received the required minimum of data from connection, an
+- * error, or the end-of file, signal this to GASS
+- */
+- if(proto->state == GLOBUS_GASS_TRANSFER_HTTP_STATE_PENDING)
+- {
+- proto->state = GLOBUS_GASS_TRANSFER_HTTP_STATE_IDLE;
+- }
+- if(proto->recv_state == GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_EOF ||
+- proto->recv_state == GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_ERROR)
+- {
+- last_data = GLOBUS_TRUE;
+- }
+-
+- if(err)
+- {
+- globus_object_free(err);
+- err = GLOBUS_NULL;
+- }
+-
+- proto->oneshot_active = GLOBUS_FALSE;
+- failure = proto->failure_occurred;
+- buf = proto->user_buffer;
+- offset = proto->user_offset;
+- request = proto->request;
+-
+- globus_l_gass_transfer_http_signal();
+- globus_l_gass_transfer_http_unlock();
+-
+- debug_printf(2, (_GTSL("calling globus_gass_transfer_proto_receive_complete()\n")));
+- globus_gass_transfer_proto_receive_complete(request,
+- buf,
+- offset,
+- failure,
+- last_data);
++ globus_gass_transfer_request_t request;
++ globus_bool_t last_data = GLOBUS_FALSE;
++ globus_bool_t failure ;
++ globus_byte_t * buf;
++ globus_size_t offset;
++ /*
++ * Received the required minimum of data from connection, an
++ * error, or the end-of file, signal this to GASS
++ */
++ if(proto->state == GLOBUS_GASS_TRANSFER_HTTP_STATE_PENDING)
++ {
++ proto->state = GLOBUS_GASS_TRANSFER_HTTP_STATE_IDLE;
++ }
++ if(proto->recv_state == GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_EOF ||
++ proto->recv_state == GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_ERROR)
++ {
++ last_data = GLOBUS_TRUE;
++ }
++
++ if(err)
++ {
++ globus_object_free(err);
++ err = GLOBUS_NULL;
++ }
++
++ proto->oneshot_active = GLOBUS_FALSE;
++ failure = proto->failure_occurred;
++ buf = proto->user_buffer;
++ offset = proto->user_offset;
++ request = proto->request;
++
++ globus_l_gass_transfer_http_signal();
++ globus_l_gass_transfer_http_unlock();
++
++ debug_printf(2, (_GTSL("calling globus_gass_transfer_proto_receive_complete()\n")));
++ globus_gass_transfer_proto_receive_complete(request,
++ buf,
++ offset,
++ failure,
++ last_data);
+ debug_printf(3, (_GTSL("Exiting %s()\n"),myname));
+- return;
++ return;
+ }
+ else
+ {
+- result = globus_l_gass_transfer_http_register_read(proto);
++ result = globus_l_gass_transfer_http_register_read(proto);
+ }
+
+ if(result != GLOBUS_SUCCESS)
+@@ -1172,7 +1172,7 @@ globus_l_gass_transfer_http_read_buffered_callback(
+ globus_l_gass_transfer_http_unlock();
+ if(err)
+ {
+- globus_object_free(err);
++ globus_object_free(err);
+ }
+ debug_printf(3, (_GTSL("Exiting %s()\n"),myname));
+ return;
+@@ -1183,35 +1183,35 @@ globus_l_gass_transfer_http_read_buffered_callback(
+ proto->oneshot_active = GLOBUS_FALSE;
+ proto->oneshot_active = GLOBUS_FALSE;
+
+-
++
+ result = globus_l_gass_transfer_http_register_close(proto);
+
+ if(err)
+ {
+- globus_object_free(err);
++ globus_object_free(err);
+ }
+
+ {
+- globus_gass_transfer_request_t request;
+- globus_byte_t *buf;
+- globus_size_t offset;
++ globus_gass_transfer_request_t request;
++ globus_byte_t *buf;
++ globus_size_t offset;
+
+- request = proto->request;
+- buf = proto->user_buffer;
+- offset = proto->user_offset;
++ request = proto->request;
++ buf = proto->user_buffer;
++ offset = proto->user_offset;
+
+ /* register close failed, act as though it was closed */
+ if (result != GLOBUS_SUCCESS)
+ {
+ globus_l_gass_transfer_http_close(proto);
+ }
+- globus_l_gass_transfer_http_unlock();
+- debug_printf(2, (_GTSL("calling globus_gass_transfer_proto_receive_complete()")));
+- globus_gass_transfer_proto_receive_complete(request,
+- buf,
+- offset,
+- GLOBUS_TRUE,
+- GLOBUS_TRUE);
++ globus_l_gass_transfer_http_unlock();
++ debug_printf(2, (_GTSL("calling globus_gass_transfer_proto_receive_complete()")));
++ globus_gass_transfer_proto_receive_complete(request,
++ buf,
++ offset,
++ GLOBUS_TRUE,
++ GLOBUS_TRUE);
+ }
+ debug_printf(3, (_GTSL("Exiting %s()\n"),myname));
+ return;
+@@ -1233,11 +1233,11 @@ globus_l_gass_transfer_http_read_buffered_callback(
+ static
+ void
+ globus_l_gass_transfer_http_close_callback(
+- void * callback_arg,
+- globus_io_handle_t * handle,
+- globus_result_t result)
++ void * callback_arg,
++ globus_io_handle_t * handle,
++ globus_result_t result)
+ {
+- globus_gass_transfer_http_request_proto_t * proto;
++ globus_gass_transfer_http_request_proto_t * proto;
+ MYNAME(globus_l_gass_transfer_http_close_callback);
+
+ debug_printf(3, (_GTSL("Entering %s()\n"),myname));
+@@ -1262,13 +1262,13 @@ globus_l_gass_transfer_http_close_callback(
+ static
+ void
+ globus_l_gass_transfer_http_close(
+- globus_gass_transfer_http_request_proto_t * proto)
++ globus_gass_transfer_http_request_proto_t * proto)
+ {
+ proto->state = GLOBUS_GASS_TRANSFER_HTTP_STATE_DONE;
+
+ if(proto->destroy_called)
+ {
+- globus_l_gass_transfer_http_proto_destroy(proto);
++ globus_l_gass_transfer_http_proto_destroy(proto);
+ }
+ globus_l_gass_transfer_http_closing--;
+
+@@ -1289,20 +1289,20 @@ globus_l_gass_transfer_http_close(
+ static
+ globus_result_t
+ globus_l_gass_transfer_http_register_close(
+- globus_gass_transfer_http_request_proto_t * proto)
++ globus_gass_transfer_http_request_proto_t * proto)
+ {
+ globus_result_t result;
+ MYNAME(globus_l_gass_transfer_http_register_close);
+-
++
+ proto->state = GLOBUS_GASS_TRANSFER_HTTP_STATE_CLOSING;
+
+ globus_l_gass_transfer_http_closing++;
+-
++
+ debug_printf(4,(_GTSL("%s(): registering close on %p\n"), myname, &proto->handle));
+ result = globus_io_register_close(
+- &proto->handle,
+- globus_l_gass_transfer_http_close_callback,
+- proto);
++ &proto->handle,
++ globus_l_gass_transfer_http_close_callback,
++ proto);
+
+ return result;
+ }
+@@ -1320,12 +1320,12 @@ globus_l_gass_transfer_http_register_close(
+ static
+ void
+ globus_l_gass_transfer_http_listener_close_callback(
+- void * callback_arg,
+- globus_io_handle_t * handle,
+- globus_result_t result)
++ void * callback_arg,
++ globus_io_handle_t * handle,
++ globus_result_t result)
+ {
+ globus_gass_transfer_http_listener_proto_t *
+- proto;
++ proto;
+ MYNAME(globus_l_gass_transfer_http_listener_close_callback);
+
+ debug_printf(3, (_GTSL("Entering %s()\n"),myname));
+@@ -1334,7 +1334,7 @@ globus_l_gass_transfer_http_listener_close_callback(
+ globus_l_gass_transfer_http_lock();
+ globus_l_gass_transfer_http_listener_close(proto);
+ globus_l_gass_transfer_http_unlock();
+- debug_printf(3, (_GTSL("Exiting %s()\n"),myname));
++ debug_printf(3, (_GTSL("Exiting %s()\n"),myname));
+ }
+ /* globus_l_gass_transfer_http_listener_close_callback() */
+
+@@ -1356,7 +1356,7 @@ globus_l_gass_transfer_http_listener_close(
+
+ if(proto->destroy_called)
+ {
+- globus_l_gass_transfer_http_listener_proto_destroy(proto);
++ globus_l_gass_transfer_http_listener_proto_destroy(proto);
+ }
+ globus_l_gass_transfer_http_closing--;
+
+@@ -1375,19 +1375,19 @@ globus_l_gass_transfer_http_register_listener_close(
+
+ debug_printf(4,(_GTSL("%s(): registering close on %p\n"), myname, &proto->handle));
+ result = globus_io_register_close(
+- &proto->handle,
+- globus_l_gass_transfer_http_listener_close_callback,
+- proto);
++ &proto->handle,
++ globus_l_gass_transfer_http_listener_close_callback,
++ proto);
+
+ globus_assert(result == GLOBUS_SUCCESS);
+
+ if(result != GLOBUS_SUCCESS)
+ {
+- globus_l_gass_transfer_http_listener_close(proto);
++ globus_l_gass_transfer_http_listener_close(proto);
+ }
+ }
+ /* globus_l_gass_transfer_http_register_listener_close() */
+-
++
+ /*
+ * Function: globus_l_gass_transfer_http_listener_proto_destroy()
+ *
+@@ -1401,7 +1401,7 @@ static
+ void
+ globus_l_gass_transfer_http_listener_proto_destroy(
+ globus_gass_transfer_http_listener_proto_t *
+- proto)
++ proto)
+ {
+ globus_free(proto);
+ }
+@@ -1419,10 +1419,10 @@ globus_l_gass_transfer_http_listener_proto_destroy(
+ static
+ void
+ globus_l_gass_transfer_http_destroy(
+- globus_gass_transfer_request_proto_t * proto,
+- globus_gass_transfer_request_t request)
++ globus_gass_transfer_request_proto_t * proto,
++ globus_gass_transfer_request_t request)
+ {
+- globus_gass_transfer_http_request_proto_t * new_proto;
++ globus_gass_transfer_http_request_proto_t * new_proto;
+ MYNAME(globus_l_gass_transfer_http_destroy);
+
+ debug_printf(1, (_GTSL("entering %s()\n"),myname));
+@@ -1434,11 +1434,11 @@ globus_l_gass_transfer_http_destroy(
+ new_proto->state == GLOBUS_GASS_TRANSFER_HTTP_STATE_RESPONDING ||
+ new_proto->state == GLOBUS_GASS_TRANSFER_HTTP_STATE_DENIED)
+ {
+- new_proto->destroy_called=GLOBUS_TRUE;
++ new_proto->destroy_called=GLOBUS_TRUE;
+ }
+ else if(new_proto->state == GLOBUS_GASS_TRANSFER_HTTP_STATE_DONE)
+ {
+- globus_l_gass_transfer_http_proto_destroy(new_proto);
++ globus_l_gass_transfer_http_proto_destroy(new_proto);
+ }
+ globus_l_gass_transfer_http_unlock();
+ debug_printf(1, (_GTSL("exiting %s()\n"),myname));
+@@ -1457,8 +1457,8 @@ globus_l_gass_transfer_http_destroy(
+ static
+ void
+ globus_l_gass_transfer_http_listener_destroy(
+- globus_gass_transfer_listener_proto_t * proto,
+- globus_gass_transfer_listener_t listener)
++ globus_gass_transfer_listener_proto_t * proto,
++ globus_gass_transfer_listener_t listener)
+ {
+ globus_gass_transfer_http_listener_proto_t *new_proto;
+ MYNAME(globus_l_gass_transfer_http_listener_destroy);
+@@ -1469,11 +1469,11 @@ globus_l_gass_transfer_http_listener_destroy(
+ globus_l_gass_transfer_http_lock();
+ if(new_proto->state != GLOBUS_GASS_TRANSFER_HTTP_LISTENER_CLOSED)
+ {
+- new_proto->destroy_called=GLOBUS_TRUE;
++ new_proto->destroy_called=GLOBUS_TRUE;
+ }
+ else
+ {
+- globus_l_gass_transfer_http_listener_proto_destroy(new_proto);
++ globus_l_gass_transfer_http_listener_proto_destroy(new_proto);
+ }
+ globus_l_gass_transfer_http_unlock();
+ debug_printf(1, (_GTSL("exiting %s()\n"),myname));
+@@ -1492,11 +1492,11 @@ globus_l_gass_transfer_http_listener_destroy(
+ static
+ void
+ globus_l_gass_transfer_http_listen(
+- globus_gass_transfer_listener_proto_t * proto,
+- globus_gass_transfer_listener_t listener)
++ globus_gass_transfer_listener_proto_t * proto,
++ globus_gass_transfer_listener_t listener)
+ {
+ globus_gass_transfer_http_listener_proto_t *new_proto;
+- globus_result_t result;
++ globus_result_t result;
+ globus_reltime_t delay_time;
+ MYNAME(globus_l_gass_transfer_http_listen);
+
+@@ -1506,28 +1506,28 @@ globus_l_gass_transfer_http_listen(
+ globus_l_gass_transfer_http_lock();
+
+ debug_printf(4,(_GTSL("%s(): registering listen on %p\n"),
+- myname,
+- &new_proto->handle));
++ myname,
++ &new_proto->handle));
+ result = globus_io_tcp_register_listen(
+- &new_proto->handle,
+- globus_l_gass_transfer_http_listen_callback,
+- (void *) new_proto);
++ &new_proto->handle,
++ globus_l_gass_transfer_http_listen_callback,
++ (void *) new_proto);
+
+ if(result != GLOBUS_SUCCESS)
+ {
+ GlobusTimeReltimeSet(delay_time, 0, 0);
+- debug_printf(4,(_GTSL("%s(): registering oneshot because listen failed\n"),
+- myname));
+- globus_callback_register_oneshot(
+- GLOBUS_NULL,
+- &delay_time,
+- globus_l_gass_transfer_http_callback_listen_callback,
+- (void *) new_proto);
+-
++ debug_printf(4,(_GTSL("%s(): registering oneshot because listen failed\n"),
++ myname));
++ globus_callback_register_oneshot(
++ GLOBUS_NULL,
++ &delay_time,
++ globus_l_gass_transfer_http_callback_listen_callback,
++ (void *) new_proto);
++
+ }
+ else
+ {
+- new_proto->state = GLOBUS_GASS_TRANSFER_HTTP_LISTENER_LISTENING;
++ new_proto->state = GLOBUS_GASS_TRANSFER_HTTP_LISTENER_LISTENING;
+ }
+ globus_l_gass_transfer_http_unlock();
+ debug_printf(1, (_GTSL("exiting %s()\n"),myname));
+@@ -1537,15 +1537,15 @@ globus_l_gass_transfer_http_listen(
+ static
+ void
+ globus_l_gass_transfer_http_listen_callback(
+- void * callback_arg,
+- globus_io_handle_t * handle,
+- globus_result_t result)
++ void * callback_arg,
++ globus_io_handle_t * handle,
++ globus_result_t result)
+ {
+ globus_gass_transfer_http_listener_proto_t *proto;
+- globus_gass_transfer_listener_t listener;
++ globus_gass_transfer_listener_t listener;
+ MYNAME(globus_l_gass_transfer_http_listen_callback);
+-
+- debug_printf(3, (_GTSL("Entering %s()\n"),myname));
++
++ debug_printf(3, (_GTSL("Entering %s()\n"),myname));
+
+ proto = (globus_gass_transfer_http_listener_proto_t *) callback_arg;
+ globus_l_gass_transfer_http_lock();
+@@ -1553,19 +1553,19 @@ globus_l_gass_transfer_http_listen_callback(
+ switch(proto->state)
+ {
+ case GLOBUS_GASS_TRANSFER_HTTP_LISTENER_LISTENING:
+- proto->state = GLOBUS_GASS_TRANSFER_HTTP_LISTENER_READY;
+- break;
++ proto->state = GLOBUS_GASS_TRANSFER_HTTP_LISTENER_READY;
++ break;
+ case GLOBUS_GASS_TRANSFER_HTTP_LISTENER_CLOSING1:
+ case GLOBUS_GASS_TRANSFER_HTTP_LISTENER_CLOSED:
+- break;
++ break;
+ case GLOBUS_GASS_TRANSFER_HTTP_LISTENER_STARTING:
+ case GLOBUS_GASS_TRANSFER_HTTP_LISTENER_ACCEPTING:
+ case GLOBUS_GASS_TRANSFER_HTTP_LISTENER_READY:
+ case GLOBUS_GASS_TRANSFER_HTTP_LISTENER_CLOSING2:
+- globus_assert(proto->state != GLOBUS_GASS_TRANSFER_HTTP_LISTENER_STARTING);
+- globus_assert(proto->state != GLOBUS_GASS_TRANSFER_HTTP_LISTENER_ACCEPTING);
+- globus_assert(proto->state != GLOBUS_GASS_TRANSFER_HTTP_LISTENER_READY);
+- globus_assert(proto->state != GLOBUS_GASS_TRANSFER_HTTP_LISTENER_CLOSING2);
++ globus_assert(proto->state != GLOBUS_GASS_TRANSFER_HTTP_LISTENER_STARTING);
++ globus_assert(proto->state != GLOBUS_GASS_TRANSFER_HTTP_LISTENER_ACCEPTING);
++ globus_assert(proto->state != GLOBUS_GASS_TRANSFER_HTTP_LISTENER_READY);
++ globus_assert(proto->state != GLOBUS_GASS_TRANSFER_HTTP_LISTENER_CLOSING2);
+ }
+
+ listener = proto->listener;
+@@ -1580,13 +1580,13 @@ globus_l_gass_transfer_http_listen_callback(
+ static
+ void
+ globus_l_gass_transfer_http_accept_callback(
+- void * callback_arg,
+- globus_io_handle_t * handle,
+- globus_result_t result)
++ void * callback_arg,
++ globus_io_handle_t * handle,
++ globus_result_t result)
+ {
+ globus_gass_transfer_http_listener_proto_t *l;
+ MYNAME(globus_l_gass_transfer_http_accept_callback);
+-
++
+ debug_printf(3, (_GTSL("Entering %s()\n"),myname));
+ globus_l_gass_transfer_http_lock();
+
+@@ -1597,84 +1597,84 @@ globus_l_gass_transfer_http_accept_callback(
+ switch(l->state)
+ {
+ case GLOBUS_GASS_TRANSFER_HTTP_LISTENER_ACCEPTING:
+- l->request->response_buffer = globus_malloc(GLOBUS_L_GASS_RESPONSE_LEN *
+- sizeof(globus_byte_t));
+- l->request->response_buflen = GLOBUS_L_GASS_RESPONSE_LEN;
+- l->request->response_offset = 0;
+- l->request->parsed_offset = 0;
+-
+- if(result != GLOBUS_SUCCESS)
+- {
+- globus_l_gass_transfer_http_unlock();
+- globus_l_gass_transfer_http_request_callback(
+- l,
+- &l->request->handle,
+- result,
+- l->request->response_buffer,
+- 0);
+- debug_printf(3, (_GTSL("Exiting globus_l_gass_transfer_http_accept_callback()\n")));
+- return;
+- }
+- else
+- {
++ l->request->response_buffer = globus_malloc(GLOBUS_L_GASS_RESPONSE_LEN *
++ sizeof(globus_byte_t));
++ l->request->response_buflen = GLOBUS_L_GASS_RESPONSE_LEN;
++ l->request->response_offset = 0;
++ l->request->parsed_offset = 0;
++
++ if(result != GLOBUS_SUCCESS)
++ {
++ globus_l_gass_transfer_http_unlock();
++ globus_l_gass_transfer_http_request_callback(
++ l,
++ &l->request->handle,
++ result,
++ l->request->response_buffer,
++ 0);
++ debug_printf(3, (_GTSL("Exiting globus_l_gass_transfer_http_accept_callback()\n")));
++ return;
++ }
++ else
++ {
+ debug_printf(4, (_GTSL("%s(): Registering read on %p\n"),
+- myname,
+- &l->request->handle));
+- globus_io_register_read(&l->request->handle,
+- l->request->response_buffer,
+- l->request->response_buflen,
+- 1,
+- globus_l_gass_transfer_http_request_callback,
+- l);
+- }
+- break;
++ myname,
++ &l->request->handle));
++ globus_io_register_read(&l->request->handle,
++ l->request->response_buffer,
++ l->request->response_buflen,
++ 1,
++ globus_l_gass_transfer_http_request_callback,
++ l);
++ }
++ break;
+
+ case GLOBUS_GASS_TRANSFER_HTTP_LISTENER_CLOSING2:
+ case GLOBUS_GASS_TRANSFER_HTTP_LISTENER_CLOSED:
+- globus_l_gass_transfer_http_unlock();
+- globus_gass_transfer_proto_new_listener_request(l->listener,
+- l->request->request,
+- GLOBUS_NULL);
+- globus_l_gass_transfer_http_lock();
+- /* should destroy the proto->request here? */
+- break;
++ globus_l_gass_transfer_http_unlock();
++ globus_gass_transfer_proto_new_listener_request(l->listener,
++ l->request->request,
++ GLOBUS_NULL);
++ globus_l_gass_transfer_http_lock();
++ /* should destroy the proto->request here? */
++ break;
+ case GLOBUS_GASS_TRANSFER_HTTP_LISTENER_STARTING:
+ case GLOBUS_GASS_TRANSFER_HTTP_LISTENER_LISTENING:
+ case GLOBUS_GASS_TRANSFER_HTTP_LISTENER_READY:
+ case GLOBUS_GASS_TRANSFER_HTTP_LISTENER_CLOSING1:
+- globus_assert(l->state != GLOBUS_GASS_TRANSFER_HTTP_LISTENER_STARTING);
+- globus_assert(l->state != GLOBUS_GASS_TRANSFER_HTTP_LISTENER_LISTENING);
+- globus_assert(l->state != GLOBUS_GASS_TRANSFER_HTTP_LISTENER_READY);
+- globus_assert(l->state != GLOBUS_GASS_TRANSFER_HTTP_LISTENER_CLOSING1);
++ globus_assert(l->state != GLOBUS_GASS_TRANSFER_HTTP_LISTENER_STARTING);
++ globus_assert(l->state != GLOBUS_GASS_TRANSFER_HTTP_LISTENER_LISTENING);
++ globus_assert(l->state != GLOBUS_GASS_TRANSFER_HTTP_LISTENER_READY);
++ globus_assert(l->state != GLOBUS_GASS_TRANSFER_HTTP_LISTENER_CLOSING1);
+ }
+ globus_l_gass_transfer_http_unlock();
+- debug_printf(3, (_GTSL("Exiting %s()\n"), myname));
++ debug_printf(3, (_GTSL("Exiting %s()\n"), myname));
+ }
+ /* globus_l_gass_transfer_http_accept_callback() */
+
+ static
+ void
+ globus_l_gass_transfer_http_request_refer(
+- globus_gass_transfer_request_proto_t * rproto,
+- globus_gass_transfer_request_t request)
++ globus_gass_transfer_request_proto_t * rproto,
++ globus_gass_transfer_request_t request)
+ {
+- globus_gass_transfer_http_request_proto_t * proto;
+- globus_gass_transfer_referral_t referral;
+- int rc;
+- char * referral_string;
+- globus_size_t referral_count;
+- globus_size_t body_count=0; /* :) */
+- globus_size_t offset;
+- globus_size_t x;
+- globus_size_t i;
+- globus_size_t digits = 0;
++ globus_gass_transfer_http_request_proto_t * proto;
++ globus_gass_transfer_referral_t referral;
++ int rc;
++ char * referral_string;
++ globus_size_t referral_count;
++ globus_size_t body_count=0; /* :) */
++ globus_size_t offset;
++ globus_size_t x;
++ globus_size_t i;
++ globus_size_t digits = 0;
+ MYNAME(globus_l_gass_transfer_http_request_refer);
+-
++
+ globus_l_gass_transfer_http_lock();
+ proto = (globus_gass_transfer_http_request_proto_t *) rproto;
+
+ rc = globus_gass_transfer_request_get_referral(request,
+- &referral);
++ &referral);
+
+ /* HTTP/1.1 302 Document Moved CRLF
+ * Location: referral.url[0] CRLF
+@@ -1701,17 +1701,17 @@ globus_l_gass_transfer_http_request_refer(
+ body_count += strlen(GLOBUS_L_HTML_REFERRAL_BODY_TAIL);
+ for(i = 0 ; i < referral.count; i++)
+ {
+- body_count += strlen(GLOBUS_L_HTML_HREF);
+- body_count += strlen(referral.url[i]);
+- body_count += strlen(referral.url[i]);
++ body_count += strlen(GLOBUS_L_HTML_HREF);
++ body_count += strlen(referral.url[i]);
++ body_count += strlen(referral.url[i]);
+ }
+
+ /* count the number of decimal digits in the body */
+ x=body_count;
+ do
+ {
+- digits++;
+- x /= 10;
++ digits++;
++ x /= 10;
+ } while(x > 0);
+
+ referral_count += digits;
+@@ -1719,43 +1719,43 @@ globus_l_gass_transfer_http_request_refer(
+ referral_string = globus_malloc(referral_count + body_count);
+
+ offset = sprintf(referral_string,
+- GLOBUS_L_REFER_RESPONSE);
++ GLOBUS_L_REFER_RESPONSE);
+ offset += sprintf(referral_string + offset,
+- GLOBUS_L_LOCATION_HEADER,
+- referral.url[0]);
++ GLOBUS_L_LOCATION_HEADER,
++ referral.url[0]);
+
+ offset += sprintf(referral_string + offset,
+- GLOBUS_L_HTML_HEADER);
++ GLOBUS_L_HTML_HEADER);
+ offset += sprintf(referral_string + offset,
+- GLOBUS_L_CONTENT_LENGTH_HEADER,
+- body_count);
++ GLOBUS_L_CONTENT_LENGTH_HEADER,
++ body_count);
+ offset += sprintf(referral_string + offset,
+- CRLF);
++ CRLF);
+
+ offset += sprintf(referral_string + offset,
+- GLOBUS_L_HTML_REFERRAL_BODY_HEAD);
++ GLOBUS_L_HTML_REFERRAL_BODY_HEAD);
+ for(i = 0 ; i < referral.count; i++)
+ {
+- offset += sprintf(referral_string + offset,
+- GLOBUS_L_HTML_HREF,
+- referral.url[i],
+- referral.url[i]);
++ offset += sprintf(referral_string + offset,
++ GLOBUS_L_HTML_HREF,
++ referral.url[i],
++ referral.url[i]);
+ }
+ offset += sprintf(referral_string + offset,
+- GLOBUS_L_HTML_REFERRAL_BODY_TAIL);
++ GLOBUS_L_HTML_REFERRAL_BODY_TAIL);
+
+ proto->state = GLOBUS_GASS_TRANSFER_HTTP_STATE_REFERRED;
+
+ globus_gass_transfer_referral_destroy(&referral);
+
+ debug_printf(4, (_GTSL("%s(): Registering write on %p\n"),
+- myname,
+- &proto->handle));
++ myname,
++ &proto->handle));
+ globus_io_register_write(&proto->handle,
+- (globus_byte_t *) referral_string,
+- strlen(referral_string),
+- globus_l_gass_transfer_http_write_response,
+- proto);
++ (globus_byte_t *) referral_string,
++ strlen(referral_string),
++ globus_l_gass_transfer_http_write_response,
++ proto);
+
+ globus_l_gass_transfer_http_unlock();
+ }
+@@ -1764,20 +1764,20 @@ globus_l_gass_transfer_http_request_refer(
+ static
+ void
+ globus_l_gass_transfer_http_request_deny(
+- globus_gass_transfer_request_proto_t * rproto,
+- globus_gass_transfer_request_t request)
++ globus_gass_transfer_request_proto_t * rproto,
++ globus_gass_transfer_request_t request)
+ {
+- globus_gass_transfer_http_request_proto_t * proto;
+- char * deny_string;
+- globus_size_t deny_count;
+- globus_size_t body_count=0; /* :) */
+- globus_size_t offset;
+- globus_size_t x;
+- globus_size_t digits = 0;
+- int reason;
+- char * message;
++ globus_gass_transfer_http_request_proto_t * proto;
++ char * deny_string;
++ globus_size_t deny_count;
++ globus_size_t body_count=0; /* :) */
++ globus_size_t offset;
++ globus_size_t x;
++ globus_size_t digits = 0;
++ int reason;
++ char * message;
+ MYNAME(globus_l_gass_transfer_http_request_deny);
+-
++
+ globus_l_gass_transfer_http_lock();
+ proto = (globus_gass_transfer_http_request_proto_t *) rproto;
+
+@@ -1786,16 +1786,16 @@ globus_l_gass_transfer_http_request_deny(
+ if(reason < 400 ||
+ reason >= 600)
+ {
+- reason = 500;
+- message = globus_libc_strdup(GLOBUS_L_DEFAULT_DENIAL_MESSAGE);
++ reason = 500;
++ message = globus_libc_strdup(GLOBUS_L_DEFAULT_DENIAL_MESSAGE);
+ }
+ else
+ {
+- message = globus_gass_transfer_request_get_denial_message(request);
+- if(message == GLOBUS_NULL)
+- {
+- message = globus_libc_strdup(GLOBUS_L_DEFAULT_DENIAL_MESSAGE);
+- }
++ message = globus_gass_transfer_request_get_denial_message(request);
++ if(message == GLOBUS_NULL)
++ {
++ message = globus_libc_strdup(GLOBUS_L_DEFAULT_DENIAL_MESSAGE);
++ }
+ }
+
+ /* HTTP/1.1 %d %s CRLF
+@@ -1822,8 +1822,8 @@ globus_l_gass_transfer_http_request_deny(
+ x=body_count;
+ do
+ {
+- digits++;
+- x /= 10;
++ digits++;
++ x /= 10;
+ } while(x > 0);
+
+ deny_count += digits;
+@@ -1831,36 +1831,36 @@ globus_l_gass_transfer_http_request_deny(
+ deny_string = globus_malloc(deny_count + body_count);
+
+ offset = sprintf(deny_string,
+- GLOBUS_L_DENIAL_RESPONSE,
+- reason,
+- message);
++ GLOBUS_L_DENIAL_RESPONSE,
++ reason,
++ message);
+ offset += sprintf(deny_string + offset,
+- GLOBUS_L_HTML_HEADER);
++ GLOBUS_L_HTML_HEADER);
+ offset += sprintf(deny_string + offset,
+- GLOBUS_L_CONTENT_LENGTH_HEADER,
+- body_count);
++ GLOBUS_L_CONTENT_LENGTH_HEADER,
++ body_count);
+ offset += sprintf(deny_string + offset,
+- CRLF);
++ CRLF);
+
+ offset += sprintf(deny_string + offset,
+- GLOBUS_L_HTML_DENIAL_BODY,
+- reason,
+- message,
+- reason,
+- message);
++ GLOBUS_L_HTML_DENIAL_BODY,
++ reason,
++ message,
++ reason,
++ message);
+
+ proto->state = GLOBUS_GASS_TRANSFER_HTTP_STATE_DENIED;
+
+ globus_free(message);
+
+ debug_printf(4, (_GTSL("%s(): Registering write on %p\n"),
+- myname,
+- &proto->handle));
++ myname,
++ &proto->handle));
+ globus_io_register_write(&proto->handle,
+- (globus_byte_t *) deny_string,
+- strlen(deny_string),
+- globus_l_gass_transfer_http_write_response,
+- proto);
++ (globus_byte_t *) deny_string,
++ strlen(deny_string),
++ globus_l_gass_transfer_http_write_response,
++ proto);
+
+ globus_l_gass_transfer_http_unlock();
+ }
+@@ -1869,117 +1869,117 @@ globus_l_gass_transfer_http_request_deny(
+ static
+ void
+ globus_l_gass_transfer_http_request_authorize(
+- globus_gass_transfer_request_proto_t * rproto,
+- globus_gass_transfer_request_t request)
++ globus_gass_transfer_request_proto_t * rproto,
++ globus_gass_transfer_request_t request)
+ {
+- globus_gass_transfer_http_request_proto_t * proto;
+- char * authorize_string;
+- globus_size_t authorize_count=0;
+- globus_size_t offset;
+- globus_size_t length;
++ globus_gass_transfer_http_request_proto_t * proto;
++ char * authorize_string;
++ globus_size_t authorize_count=0;
++ globus_size_t offset;
++ globus_size_t length;
+ globus_reltime_t delay_time;
+ MYNAME(globus_l_gass_transfer_http_request_authorize);
+-
++
+ globus_l_gass_transfer_http_lock();
+ proto = (globus_gass_transfer_http_request_proto_t *) rproto;
+
+ switch(proto->type)
+ {
+ case GLOBUS_GASS_TRANSFER_REQUEST_TYPE_GET:
+- /* Let's always send an HTTP/1.0 response, to make things easier */
+- length = globus_gass_transfer_request_get_length(proto->request);
+-
+- if(length != 0)
+- {
+- globus_size_t x = length;
+- globus_size_t digits = 0;
+-
+- /* count the number of decimal digits in length */
+- do
+- {
+- digits++;
+- x /= 10;
+- } while(x > 0);
+-
+- /* Send a content-length field */
+- authorize_count += strlen(GLOBUS_L_CONTENT_LENGTH_HEADER);
+- authorize_count += digits;
+- }
+-
+- authorize_count += 1;
+- authorize_count += strlen(GLOBUS_L_GENERIC_RESPONSE);
+- authorize_count += 3;
+- authorize_count += strlen(GLOBUS_L_OK);
+- authorize_count += 2;
+-
+- if(proto->text_mode)
+- {
+- authorize_count += strlen(GLOBUS_L_TEXT_HEADER);
+- authorize_string = globus_malloc(authorize_count);
+- offset = sprintf(authorize_string,
+- GLOBUS_L_GENERIC_RESPONSE,
+- 0,
+- 200,
+- GLOBUS_L_OK);
+- offset += sprintf(authorize_string + offset,
+- GLOBUS_L_TEXT_HEADER);
+- }
+- else
+- {
+- authorize_count += strlen(GLOBUS_L_BINARY_HEADER);
+- authorize_string = globus_malloc(authorize_count);
+- offset = sprintf(authorize_string,
+- GLOBUS_L_GENERIC_RESPONSE,
+- 0,
+- 200,
+- GLOBUS_L_OK);
+- offset += sprintf(authorize_string + offset,
+- GLOBUS_L_BINARY_HEADER);
+- }
+-
+- if(length != 0)
+- {
+- offset += sprintf(authorize_string + offset,
+- GLOBUS_L_CONTENT_LENGTH_HEADER,
+- length);
+- }
+- offset += sprintf(authorize_string + offset,
+- CRLF);
+- break;
++ /* Let's always send an HTTP/1.0 response, to make things easier */
++ length = globus_gass_transfer_request_get_length(proto->request);
++
++ if(length != 0)
++ {
++ globus_size_t x = length;
++ globus_size_t digits = 0;
++
++ /* count the number of decimal digits in length */
++ do
++ {
++ digits++;
++ x /= 10;
++ } while(x > 0);
++
++ /* Send a content-length field */
++ authorize_count += strlen(GLOBUS_L_CONTENT_LENGTH_HEADER);
++ authorize_count += digits;
++ }
++
++ authorize_count += 1;
++ authorize_count += strlen(GLOBUS_L_GENERIC_RESPONSE);
++ authorize_count += 3;
++ authorize_count += strlen(GLOBUS_L_OK);
++ authorize_count += 2;
++
++ if(proto->text_mode)
++ {
++ authorize_count += strlen(GLOBUS_L_TEXT_HEADER);
++ authorize_string = globus_malloc(authorize_count);
++ offset = sprintf(authorize_string,
++ GLOBUS_L_GENERIC_RESPONSE,
++ 0,
++ 200,
++ GLOBUS_L_OK);
++ offset += sprintf(authorize_string + offset,
++ GLOBUS_L_TEXT_HEADER);
++ }
++ else
++ {
++ authorize_count += strlen(GLOBUS_L_BINARY_HEADER);
++ authorize_string = globus_malloc(authorize_count);
++ offset = sprintf(authorize_string,
++ GLOBUS_L_GENERIC_RESPONSE,
++ 0,
++ 200,
++ GLOBUS_L_OK);
++ offset += sprintf(authorize_string + offset,
++ GLOBUS_L_BINARY_HEADER);
++ }
++
++ if(length != 0)
++ {
++ offset += sprintf(authorize_string + offset,
++ GLOBUS_L_CONTENT_LENGTH_HEADER,
++ length);
++ }
++ offset += sprintf(authorize_string + offset,
++ CRLF);
++ break;
+ case GLOBUS_GASS_TRANSFER_REQUEST_TYPE_PUT:
+ case GLOBUS_GASS_TRANSFER_REQUEST_TYPE_APPEND:
+- /* send nothing back yet */
+- break;
++ /* send nothing back yet */
++ break;
+ default:
+- globus_assert(GLOBUS_FALSE);
++ globus_assert(GLOBUS_FALSE);
+ }
+
+ if(authorize_count != 0)
+ {
+- proto->state = GLOBUS_GASS_TRANSFER_HTTP_STATE_RESPONDING;
++ proto->state = GLOBUS_GASS_TRANSFER_HTTP_STATE_RESPONDING;
+
+- debug_printf(4, (_GTSL("%s(): registering write on %p\n"),
+- myname,
+- &proto->handle));
++ debug_printf(4, (_GTSL("%s(): registering write on %p\n"),
++ myname,
++ &proto->handle));
+
+- globus_io_register_write(&proto->handle,
+- (globus_byte_t *) authorize_string,
+- strlen(authorize_string),
+- globus_l_gass_transfer_http_write_response,
+- proto);
++ globus_io_register_write(&proto->handle,
++ (globus_byte_t *) authorize_string,
++ strlen(authorize_string),
++ globus_l_gass_transfer_http_write_response,
++ proto);
+ }
+ else
+ {
+- proto->state = GLOBUS_GASS_TRANSFER_HTTP_STATE_IDLE;
+-
++ proto->state = GLOBUS_GASS_TRANSFER_HTTP_STATE_IDLE;
++
+ GlobusTimeReltimeSet(delay_time, 0, 0);
+- debug_printf(4, (_GTSL("%s(): registering oneshot\n"),
+- myname));
+- globus_callback_register_oneshot(
+- GLOBUS_NULL,
+- &delay_time,
+- globus_l_gass_transfer_http_callback_ready_callback,
+- (void *) proto);
++ debug_printf(4, (_GTSL("%s(): registering oneshot\n"),
++ myname));
++ globus_callback_register_oneshot(
++ GLOBUS_NULL,
++ &delay_time,
++ globus_l_gass_transfer_http_callback_ready_callback,
++ (void *) proto);
+
+ }
+
+@@ -1990,14 +1990,14 @@ globus_l_gass_transfer_http_request_authorize(
+ static
+ void
+ globus_l_gass_transfer_http_write_response(
+- void * arg,
+- globus_io_handle_t * handle,
+- globus_result_t result,
+- globus_byte_t * buf,
+- globus_size_t nbytes)
++ void * arg,
++ globus_io_handle_t * handle,
++ globus_result_t result,
++ globus_byte_t * buf,
++ globus_size_t nbytes)
+ {
+ globus_gass_transfer_http_request_proto_t * proto;
+- globus_gass_transfer_request_t request;
++ globus_gass_transfer_request_t request;
+
+ globus_free(buf);
+
+@@ -2008,28 +2008,28 @@ globus_l_gass_transfer_http_write_response(
+ switch(proto->state)
+ {
+ case GLOBUS_GASS_TRANSFER_HTTP_STATE_RESPONDING:
+- if(proto->type == GLOBUS_GASS_TRANSFER_REQUEST_TYPE_GET)
+- {
+- proto->state = GLOBUS_GASS_TRANSFER_HTTP_STATE_IDLE;
+- globus_l_gass_transfer_http_unlock();
+-
+- request = proto->request;
+-
+- debug_printf(2, (_GTSL("calling globus_gass_transfer_proto_request_ready")));
+- globus_gass_transfer_proto_request_ready(request,
+- (globus_gass_transfer_request_proto_t *) proto);
+- return;
+- }
+- /* other types fall through */
++ if(proto->type == GLOBUS_GASS_TRANSFER_REQUEST_TYPE_GET)
++ {
++ proto->state = GLOBUS_GASS_TRANSFER_HTTP_STATE_IDLE;
++ globus_l_gass_transfer_http_unlock();
++
++ request = proto->request;
++
++ debug_printf(2, (_GTSL("calling globus_gass_transfer_proto_request_ready")));
++ globus_gass_transfer_proto_request_ready(request,
++ (globus_gass_transfer_request_proto_t *) proto);
++ return;
++ }
++ /* other types fall through */
+ default:
+- result = globus_l_gass_transfer_http_register_close(proto);
++ result = globus_l_gass_transfer_http_register_close(proto);
+
+ if (result != GLOBUS_SUCCESS)
+ {
+ globus_l_gass_transfer_http_close(proto);
+ }
+- globus_l_gass_transfer_http_unlock();
+- return;
++ globus_l_gass_transfer_http_unlock();
++ return;
+ }
+ }
+ /* globus_l_gass_transfer_http_write_response() */
+@@ -2037,14 +2037,14 @@ globus_l_gass_transfer_http_write_response(
+ static
+ globus_bool_t
+ globus_l_gass_transfer_http_authorization_callback(
+- void * arg,
+- globus_io_handle_t * handle,
+- globus_result_t result,
+- char * identity,
+- gss_ctx_id_t context_handle)
++ void * arg,
++ globus_io_handle_t * handle,
++ globus_result_t result,
++ char * identity,
++ gss_ctx_id_t context_handle)
+ {
+ globus_gass_transfer_http_listener_proto_t *proto;
+- int rc = GLOBUS_FALSE;
++ int rc = GLOBUS_FALSE;
+ MYNAME(globus_l_gass_transfer_http_authorization_callback);
+
+ debug_printf(3, (_GTSL("Entering %s()\n"),myname));
+@@ -2056,33 +2056,33 @@ globus_l_gass_transfer_http_authorization_callback(
+ switch(proto->request->authorization_mode)
+ {
+ case GLOBUS_GASS_TRANSFER_AUTHORIZE_SELF:
+- if(strcmp(identity, globus_l_gass_transfer_http_subject_name) == 0)
+- {
+- rc = GLOBUS_TRUE;
+- goto finish;
+- }
+- else
+- {
+- rc = GLOBUS_FALSE;
+- goto finish;
+- }
++ if(strcmp(identity, globus_l_gass_transfer_http_subject_name) == 0)
++ {
++ rc = GLOBUS_TRUE;
++ goto finish;
++ }
++ else
++ {
++ rc = GLOBUS_FALSE;
++ goto finish;
++ }
+ case GLOBUS_GASS_TRANSFER_AUTHORIZE_HOST:
+- rc = GLOBUS_FALSE;
+- goto finish;
++ rc = GLOBUS_FALSE;
++ goto finish;
+ case GLOBUS_GASS_TRANSFER_AUTHORIZE_SUBJECT:
+- if(strcmp(identity, proto->request->authorized_subject) == 0)
+- {
+- rc = GLOBUS_TRUE;
+- goto finish;
+- }
+- else
+- {
+- rc = GLOBUS_FALSE;
+- goto finish;
+- }
++ if(strcmp(identity, proto->request->authorized_subject) == 0)
++ {
++ rc = GLOBUS_TRUE;
++ goto finish;
++ }
++ else
++ {
++ rc = GLOBUS_FALSE;
++ goto finish;
++ }
+ case GLOBUS_GASS_TRANSFER_AUTHORIZE_CALLBACK:
+- rc = GLOBUS_TRUE;
+- goto finish;
++ rc = GLOBUS_TRUE;
++ goto finish;
+ }
+
+ finish:
+@@ -2096,15 +2096,15 @@ globus_l_gass_transfer_http_authorization_callback(
+ static
+ void
+ globus_l_gass_transfer_http_proto_destroy(
+- globus_gass_transfer_http_request_proto_t * proto)
++ globus_gass_transfer_http_request_proto_t * proto)
+ {
+ if(proto->response_buffer != GLOBUS_NULL)
+ {
+- globus_free(proto->response_buffer);
++ globus_free(proto->response_buffer);
+ }
+ if(proto->reason != GLOBUS_NULL)
+ {
+- globus_free(proto->reason);
++ globus_free(proto->reason);
+ }
+ if(proto->connected_subject != GLOBUS_NULL)
+ {
+@@ -2112,21 +2112,21 @@ globus_l_gass_transfer_http_proto_destroy(
+ }
+ if(proto->client_side)
+ {
+- globus_url_destroy(&proto->url);
++ globus_url_destroy(&proto->url);
+ }
+ else
+ {
+- if(proto->method)
+- {
+- globus_free(proto->method);
+- }
+- if(proto->uri)
+- {
+- globus_free(proto->uri);
+- }
++ if(proto->method)
++ {
++ globus_free(proto->method);
++ }
++ if(proto->uri)
++ {
++ globus_free(proto->uri);
++ }
+ }
+ globus_i_gass_transfer_keyvalue_destroy(
+- &proto->headers);
++ &proto->headers);
+ globus_free(proto);
+ }
+ /* globus_l_gass_transfer_http_proto_destroy() */
+@@ -2143,266 +2143,266 @@ globus_l_gass_transfer_http_proto_destroy(
+ static
+ void
+ globus_l_gass_transfer_http_new_request(
+- globus_gass_transfer_request_t request,
+- globus_gass_transfer_requestattr_t * attr)
++ globus_gass_transfer_request_t request,
++ globus_gass_transfer_requestattr_t * attr)
+ {
+- int rc=GLOBUS_SUCCESS;
+- char * proxy=GLOBUS_NULL;
+- globus_gass_transfer_file_mode_t file_mode=GLOBUS_GASS_TRANSFER_FILE_MODE_BINARY;
+- globus_io_attr_t tcp_attr;
+- globus_result_t result;
+- globus_gass_transfer_http_request_proto_t * proto;
+- int sndbuf;
+- int rcvbuf;
+- int nodelay;
++ int rc=GLOBUS_SUCCESS;
++ char * proxy=GLOBUS_NULL;
++ globus_gass_transfer_file_mode_t file_mode=GLOBUS_GASS_TRANSFER_FILE_MODE_BINARY;
++ globus_io_attr_t tcp_attr;
++ globus_result_t result;
++ globus_gass_transfer_http_request_proto_t * proto;
++ int sndbuf;
++ int rcvbuf;
++ int nodelay;
+ globus_reltime_t delay_time;
+ MYNAME(globus_l_gass_transfer_http_new_request);
+-
++
+ debug_printf(1, (_GTSL("Entering %s()\n"),myname));
+ switch(globus_gass_transfer_request_get_type(request))
+ {
+ case GLOBUS_GASS_TRANSFER_REQUEST_TYPE_GET:
+ case GLOBUS_GASS_TRANSFER_REQUEST_TYPE_PUT:
+ case GLOBUS_GASS_TRANSFER_REQUEST_TYPE_APPEND:
+- break;
++ break;
+ default:
+- goto error_exit;
++ goto error_exit;
+ }
+
+ /* Allocate proto instance */
+- proto = (globus_gass_transfer_http_request_proto_t *)
+- globus_malloc(sizeof(globus_gass_transfer_http_request_proto_t));
++ proto = (globus_gass_transfer_http_request_proto_t *)
++ globus_malloc(sizeof(globus_gass_transfer_http_request_proto_t));
+
+ if(proto == GLOBUS_NULL)
+ {
+- goto error_exit;
++ goto error_exit;
+ }
+
+ result = globus_io_tcpattr_init(&tcp_attr);
+ if(result != GLOBUS_SUCCESS)
+ {
+- goto proto_error;
++ goto proto_error;
+ }
+ globus_io_attr_set_socket_keepalive(&tcp_attr, GLOBUS_TRUE);
+
+ if(*attr != GLOBUS_NULL)
+ {
+- /* Check attributes we care about */
+- globus_gass_transfer_requestattr_get_proxy_url(attr,
+- &proxy);
+-
+- rc = globus_gass_transfer_requestattr_get_socket_sndbuf(
+- attr,
+- &sndbuf);
+- if(rc != GLOBUS_SUCCESS)
+- {
+- goto tcpattr_error;
+- }
+- else
+- {
+- if(sndbuf != 0)
+- {
+- globus_io_attr_set_socket_sndbuf(&tcp_attr,
+- sndbuf);
+- }
+- }
+-
+- rc = globus_gass_transfer_requestattr_get_socket_rcvbuf(
+- attr,
+- &rcvbuf);
+- if(rc != GLOBUS_SUCCESS)
+- {
+- goto tcpattr_error;
+- }
+- else
+- {
+- if(rcvbuf != 0)
+- {
+- globus_io_attr_set_socket_rcvbuf(&tcp_attr,
+- rcvbuf);
+- }
+- }
+-
+- rc = globus_gass_transfer_requestattr_get_socket_nodelay(
+- attr,
+- &nodelay);
+- if(rc != GLOBUS_SUCCESS)
+- {
+- goto tcpattr_error;
+- }
+- else
+- {
+- globus_io_attr_set_tcp_nodelay(&tcp_attr,
+- nodelay);
+- }
+-
+- /* File mode is important on Windows */
+- rc = globus_gass_transfer_requestattr_get_file_mode(attr,
+- &file_mode);
+- if(rc != GLOBUS_SUCCESS)
+- {
+- goto tcpattr_error;
+- }
+- rc = globus_gass_transfer_requestattr_get_block_size(attr,
+- &proto->block_size);
+- if(rc != GLOBUS_SUCCESS)
+- {
+- goto tcpattr_error;
+- }
++ /* Check attributes we care about */
++ globus_gass_transfer_requestattr_get_proxy_url(attr,
++ &proxy);
++
++ rc = globus_gass_transfer_requestattr_get_socket_sndbuf(
++ attr,
++ &sndbuf);
++ if(rc != GLOBUS_SUCCESS)
++ {
++ goto tcpattr_error;
++ }
++ else
++ {
++ if(sndbuf != 0)
++ {
++ globus_io_attr_set_socket_sndbuf(&tcp_attr,
++ sndbuf);
++ }
++ }
++
++ rc = globus_gass_transfer_requestattr_get_socket_rcvbuf(
++ attr,
++ &rcvbuf);
++ if(rc != GLOBUS_SUCCESS)
++ {
++ goto tcpattr_error;
++ }
++ else
++ {
++ if(rcvbuf != 0)
++ {
++ globus_io_attr_set_socket_rcvbuf(&tcp_attr,
++ rcvbuf);
++ }
++ }
++
++ rc = globus_gass_transfer_requestattr_get_socket_nodelay(
++ attr,
++ &nodelay);
++ if(rc != GLOBUS_SUCCESS)
++ {
++ goto tcpattr_error;
++ }
++ else
++ {
++ globus_io_attr_set_tcp_nodelay(&tcp_attr,
++ nodelay);
++ }
++
++ /* File mode is important on Windows */
++ rc = globus_gass_transfer_requestattr_get_file_mode(attr,
++ &file_mode);
++ if(rc != GLOBUS_SUCCESS)
++ {
++ goto tcpattr_error;
++ }
++ rc = globus_gass_transfer_requestattr_get_block_size(attr,
++ &proto->block_size);
++ if(rc != GLOBUS_SUCCESS)
++ {
++ goto tcpattr_error;
++ }
+ }
+
+ /* Verify URL */
+ if(proxy)
+ {
+- rc = globus_url_parse(proxy,
+- &proto->proxy_url);
+- if(rc != GLOBUS_SUCCESS)
+- {
+- goto tcpattr_error;
+- }
+- if(strcmp(proto->proxy_url.scheme, "http") != 0 &&
+- strcmp(proto->proxy_url.scheme, "https") != 0)
+- {
+- goto proxy_error;
+- }
++ rc = globus_url_parse(proxy,
++ &proto->proxy_url);
++ if(rc != GLOBUS_SUCCESS)
++ {
++ goto tcpattr_error;
++ }
++ if(strcmp(proto->proxy_url.scheme, "http") != 0 &&
++ strcmp(proto->proxy_url.scheme, "https") != 0)
++ {
++ goto proxy_error;
++ }
+ }
+ proto->url_string = globus_gass_transfer_request_get_url(request);
+
+ rc = globus_url_parse(proto->url_string,
+- &proto->url);
++ &proto->url);
+ if(rc != GLOBUS_SUCCESS)
+ {
+- goto proxy_error;
++ goto proxy_error;
+ }
+ if(proto->url.url_path == GLOBUS_NULL)
+ {
+- proto->url.url_path = globus_libc_strdup("/");
++ proto->url.url_path = globus_libc_strdup("/");
+ }
+ if(strcmp(proto->url.scheme, "http") != 0 &&
+ strcmp(proto->url.scheme, "https") != 0)
+ {
+- goto url_error;
++ goto url_error;
+ }
+
+
+ /* If https, set security attributes of TCP handle */
+ if(strcmp(proto->url.scheme, "https")== 0)
+ {
+- globus_io_secure_authorization_data_t data;
+- globus_gass_transfer_authorization_t mode;
+- char * subject;
+- globus_result_t result;
+-
+-
+- globus_io_secure_authorization_data_initialize(&data);
+- result = globus_io_attr_set_secure_authentication_mode(
+- &tcp_attr,
+- GLOBUS_IO_SECURE_AUTHENTICATION_MODE_MUTUAL,
+- GLOBUS_NULL);
+-
+- if(result != GLOBUS_SUCCESS)
+- {
+- goto url_error;
+- }
+- result = globus_io_attr_set_secure_channel_mode(
+- &tcp_attr,
+- GLOBUS_IO_SECURE_CHANNEL_MODE_SSL_WRAP);
+- if(result != GLOBUS_SUCCESS)
+- {
+- goto url_error;
+- }
+- if(*attr != GLOBUS_NULL)
+- {
+- rc = globus_gass_transfer_secure_requestattr_get_authorization(
+- attr,
+- &mode,
+- &subject);
+- if(rc != GLOBUS_SUCCESS)
+- {
+- goto url_error;
+- }
+- }
+- else
+- {
+- mode = GLOBUS_GASS_TRANSFER_AUTHORIZE_SELF;
+- }
+-
+- switch(mode)
+- {
+- case GLOBUS_GASS_TRANSFER_AUTHORIZE_SELF:
+- globus_io_attr_set_secure_authorization_mode(
+- &tcp_attr,
+- GLOBUS_IO_SECURE_AUTHORIZATION_MODE_SELF,
+- GLOBUS_NULL);
+- break;
+- case GLOBUS_GASS_TRANSFER_AUTHORIZE_HOST:
+- subject = globus_malloc(strlen(proto->url.host) +
+- strlen("/CN=")
+- +1);
+- sprintf(subject,
+- "/CN=%s",
+- proto->url.host);
+-
+- globus_io_secure_authorization_data_set_identity(
+- &data,
+- subject);
+- globus_io_attr_set_secure_authorization_mode(
+- &tcp_attr,
+- GLOBUS_IO_SECURE_AUTHORIZATION_MODE_IDENTITY,
+- &data);
+- globus_io_secure_authorization_data_destroy(&data);
+- globus_free(subject);
+- break;
+- case GLOBUS_GASS_TRANSFER_AUTHORIZE_SUBJECT:
+- globus_io_secure_authorization_data_set_identity(
+- &data,
+- subject);
+- globus_io_attr_set_secure_authorization_mode(
+- &tcp_attr,
+- GLOBUS_IO_SECURE_AUTHORIZATION_MODE_IDENTITY,
+- &data);
+- globus_io_secure_authorization_data_destroy(&data);
+- break;
+- case GLOBUS_GASS_TRANSFER_AUTHORIZE_CALLBACK:
+- globus_assert(mode != GLOBUS_GASS_TRANSFER_AUTHORIZE_CALLBACK);
+- goto url_error;
+- }
++ globus_io_secure_authorization_data_t data;
++ globus_gass_transfer_authorization_t mode;
++ char * subject;
++ globus_result_t result;
++
++
++ globus_io_secure_authorization_data_initialize(&data);
++ result = globus_io_attr_set_secure_authentication_mode(
++ &tcp_attr,
++ GLOBUS_IO_SECURE_AUTHENTICATION_MODE_MUTUAL,
++ GLOBUS_NULL);
++
++ if(result != GLOBUS_SUCCESS)
++ {
++ goto url_error;
++ }
++ result = globus_io_attr_set_secure_channel_mode(
++ &tcp_attr,
++ GLOBUS_IO_SECURE_CHANNEL_MODE_SSL_WRAP);
++ if(result != GLOBUS_SUCCESS)
++ {
++ goto url_error;
++ }
++ if(*attr != GLOBUS_NULL)
++ {
++ rc = globus_gass_transfer_secure_requestattr_get_authorization(
++ attr,
++ &mode,
++ &subject);
++ if(rc != GLOBUS_SUCCESS)
++ {
++ goto url_error;
++ }
++ }
++ else
++ {
++ mode = GLOBUS_GASS_TRANSFER_AUTHORIZE_SELF;
++ }
++
++ switch(mode)
++ {
++ case GLOBUS_GASS_TRANSFER_AUTHORIZE_SELF:
++ globus_io_attr_set_secure_authorization_mode(
++ &tcp_attr,
++ GLOBUS_IO_SECURE_AUTHORIZATION_MODE_SELF,
++ GLOBUS_NULL);
++ break;
++ case GLOBUS_GASS_TRANSFER_AUTHORIZE_HOST:
++ subject = globus_malloc(strlen(proto->url.host) +
++ strlen("/CN=")
++ +1);
++ sprintf(subject,
++ "/CN=%s",
++ proto->url.host);
++
++ globus_io_secure_authorization_data_set_identity(
++ &data,
++ subject);
++ globus_io_attr_set_secure_authorization_mode(
++ &tcp_attr,
++ GLOBUS_IO_SECURE_AUTHORIZATION_MODE_IDENTITY,
++ &data);
++ globus_io_secure_authorization_data_destroy(&data);
++ globus_free(subject);
++ break;
++ case GLOBUS_GASS_TRANSFER_AUTHORIZE_SUBJECT:
++ globus_io_secure_authorization_data_set_identity(
++ &data,
++ subject);
++ globus_io_attr_set_secure_authorization_mode(
++ &tcp_attr,
++ GLOBUS_IO_SECURE_AUTHORIZATION_MODE_IDENTITY,
++ &data);
++ globus_io_secure_authorization_data_destroy(&data);
++ break;
++ case GLOBUS_GASS_TRANSFER_AUTHORIZE_CALLBACK:
++ globus_assert(mode != GLOBUS_GASS_TRANSFER_AUTHORIZE_CALLBACK);
++ goto url_error;
++ }
+ }
+
+ if(proto == GLOBUS_NULL)
+ {
+- goto url_error;
++ goto url_error;
+ }
+
+ /* Initialize the proto instance */
+- proto->send_buffer = globus_l_gass_transfer_http_send;
+- proto->recv_buffer = globus_l_gass_transfer_http_receive;
+- proto->fail = globus_l_gass_transfer_http_fail;
+- proto->deny = GLOBUS_NULL;
+- proto->refer = GLOBUS_NULL;
+- proto->authorize = GLOBUS_NULL;
+- proto->destroy = globus_l_gass_transfer_http_destroy;
+- proto->text_mode = (file_mode == GLOBUS_GASS_TRANSFER_FILE_MODE_TEXT);
+- proto->line_mode = GLOBUS_L_LINE_MODE_UNKNOWN;
+- proto->state = GLOBUS_GASS_TRANSFER_HTTP_STATE_CONNECTING;
+- proto->request = request;
+- proto->type = globus_gass_transfer_request_get_type(request);
+- proto->code = 0;
+- proto->reason = 0;
+- proto->parse_error = GLOBUS_FALSE;
++ proto->send_buffer = globus_l_gass_transfer_http_send;
++ proto->recv_buffer = globus_l_gass_transfer_http_receive;
++ proto->fail = globus_l_gass_transfer_http_fail;
++ proto->deny = GLOBUS_NULL;
++ proto->refer = GLOBUS_NULL;
++ proto->authorize = GLOBUS_NULL;
++ proto->destroy = globus_l_gass_transfer_http_destroy;
++ proto->text_mode = (file_mode == GLOBUS_GASS_TRANSFER_FILE_MODE_TEXT);
++ proto->line_mode = GLOBUS_L_LINE_MODE_UNKNOWN;
++ proto->state = GLOBUS_GASS_TRANSFER_HTTP_STATE_CONNECTING;
++ proto->request = request;
++ proto->type = globus_gass_transfer_request_get_type(request);
++ proto->code = 0;
++ proto->reason = 0;
++ proto->parse_error = GLOBUS_FALSE;
+ proto->destroy_called = GLOBUS_FALSE;
+- proto->headers = GLOBUS_NULL;
++ proto->headers = GLOBUS_NULL;
+ proto->response_buffer = GLOBUS_NULL;
+- proto->length = 0;
+- proto->handled = 0;
+- proto->chunked = GLOBUS_FALSE;
+- proto->chunk_left = 0;
++ proto->length = 0;
++ proto->handled = 0;
++ proto->chunked = GLOBUS_FALSE;
++ proto->chunk_left = 0;
+ proto->failure_occurred = GLOBUS_FALSE;
+ proto->oneshot_registered = GLOBUS_FALSE;
+ proto->oneshot_active = GLOBUS_FALSE;
+- proto->eof_read = GLOBUS_FALSE;
+- proto->client_side = GLOBUS_TRUE;
+- proto->connected_subject = GLOBUS_NULL;
++ proto->eof_read = GLOBUS_FALSE;
++ proto->client_side = GLOBUS_TRUE;
++ proto->connected_subject = GLOBUS_NULL;
+ proto->proxy_connect = proxy ? GLOBUS_TRUE : GLOBUS_FALSE;
+ proto->got_response = GLOBUS_FALSE;
+ proto->waiting_for_response = GLOBUS_FALSE;
+@@ -2410,58 +2410,58 @@ globus_l_gass_transfer_http_new_request(
+ /* Open the handle */
+ if(proxy)
+ {
+- if(proto->proxy_url.scheme_type == GLOBUS_URL_SCHEME_HTTP &&
+- proto->proxy_url.port == 0)
+- {
+- proto->proxy_url.port = GLOBUS_L_DEFAULT_HTTP_PORT;
+- }
+- else if(proto->proxy_url.scheme_type == GLOBUS_URL_SCHEME_HTTPS &&
+- proto->proxy_url.port == 0)
+- {
+- proto->proxy_url.port = GLOBUS_L_DEFAULT_HTTPS_PORT;
+- }
+- debug_printf(4,(_GTSL("%s(): Registering connect to %s\n"),
+- myname,
+- proto->proxy_url.host));
+- result = globus_io_tcp_register_connect(
+- proto->proxy_url.host,
+- proto->proxy_url.port,
+- &tcp_attr,
+- globus_l_gass_transfer_http_connect_callback,
+- proto,
+- &proto->handle);
++ if(proto->proxy_url.scheme_type == GLOBUS_URL_SCHEME_HTTP &&
++ proto->proxy_url.port == 0)
++ {
++ proto->proxy_url.port = GLOBUS_L_DEFAULT_HTTP_PORT;
++ }
++ else if(proto->proxy_url.scheme_type == GLOBUS_URL_SCHEME_HTTPS &&
++ proto->proxy_url.port == 0)
++ {
++ proto->proxy_url.port = GLOBUS_L_DEFAULT_HTTPS_PORT;
++ }
++ debug_printf(4,(_GTSL("%s(): Registering connect to %s\n"),
++ myname,
++ proto->proxy_url.host));
++ result = globus_io_tcp_register_connect(
++ proto->proxy_url.host,
++ proto->proxy_url.port,
++ &tcp_attr,
++ globus_l_gass_transfer_http_connect_callback,
++ proto,
++ &proto->handle);
+ }
+ else
+ {
+- if(proto->url.scheme_type == GLOBUS_URL_SCHEME_HTTP &&
+- proto->url.port == 0)
+- {
+- proto->url.port = GLOBUS_L_DEFAULT_HTTP_PORT;
+- }
+- else if(proto->url.scheme_type == GLOBUS_URL_SCHEME_HTTPS &&
+- proto->url.port == 0)
+- {
+- proto->url.port = GLOBUS_L_DEFAULT_HTTPS_PORT;
+- }
+- debug_printf(4,(_GTSL("%s(): Registering connect to %s\n"),
+- myname,
+- proto->url.host));
+- result = globus_io_tcp_register_connect(
+- proto->url.host,
+- proto->url.port,
+- &tcp_attr,
+- globus_l_gass_transfer_http_connect_callback,
+- proto,
+- &proto->handle);
+- }
+- if(proxy)
+- {
+- globus_url_destroy(&proto->proxy_url);
++ if(proto->url.scheme_type == GLOBUS_URL_SCHEME_HTTP &&
++ proto->url.port == 0)
++ {
++ proto->url.port = GLOBUS_L_DEFAULT_HTTP_PORT;
++ }
++ else if(proto->url.scheme_type == GLOBUS_URL_SCHEME_HTTPS &&
++ proto->url.port == 0)
++ {
++ proto->url.port = GLOBUS_L_DEFAULT_HTTPS_PORT;
++ }
++ debug_printf(4,(_GTSL("%s(): Registering connect to %s\n"),
++ myname,
++ proto->url.host));
++ result = globus_io_tcp_register_connect(
++ proto->url.host,
++ proto->url.port,
++ &tcp_attr,
++ globus_l_gass_transfer_http_connect_callback,
++ proto,
++ &proto->handle);
++ }
++ if(proxy)
++ {
++ globus_url_destroy(&proto->proxy_url);
+ }
+
+ if(result != GLOBUS_SUCCESS)
+ {
+- goto url_error;
++ goto url_error;
+ }
+ /* Success! */
+ globus_io_tcpattr_destroy(&tcp_attr);
+@@ -2473,22 +2473,22 @@ globus_l_gass_transfer_http_new_request(
+ proxy_error:
+ if(proxy)
+ {
+- globus_url_destroy(&proto->proxy_url);
++ globus_url_destroy(&proto->proxy_url);
+ }
+ tcpattr_error:
+ globus_io_tcpattr_destroy(&tcp_attr);
+ proto_error:
+ globus_free(proto);
+ error_exit:
+-
++
+ GlobusTimeReltimeSet(delay_time, 0, 0);
+ debug_printf(4,(_GTSL("%s(): Registering oneshot\n"),
+- myname));
++ myname));
+ globus_callback_register_oneshot(
+ GLOBUS_NULL,
+- &delay_time,
+- globus_l_gass_transfer_http_callback_denied,
+- (void *) (intptr_t) request);
++ &delay_time,
++ globus_l_gass_transfer_http_callback_denied,
++ (void *) (intptr_t) request);
+
+ debug_printf(1, (_GTSL("Exiting %s()\n"),myname));
+ }
+@@ -2509,48 +2509,48 @@ globus_object_t *
+ globus_l_gass_transfer_http_new_requestattr(
+ char * url_scheme)
+ {
+- globus_object_t * obj;
++ globus_object_t * obj;
+ MYNAME(globus_l_gass_transfer_http_new_requestattr);
+
+ debug_printf(1, (_GTSL("Entering %s()\n"),myname));
+ if(strcmp(url_scheme, "https") == 0)
+ {
+- obj = globus_object_construct(GLOBUS_GASS_OBJECT_TYPE_SECURE_REQUESTATTR);
+-
+- debug_printf(1, (_GTSL("Exiting %s()\n"),myname));
+- return
+- globus_gass_transfer_secure_requestattr_initialize(
+- obj,
+- GLOBUS_NULL,
+- 0,
+- GLOBUS_GASS_TRANSFER_FILE_MODE_BINARY,
+- GLOBUS_FALSE,
+- 0,
+- 0,
+- GLOBUS_FALSE,
+- GLOBUS_GASS_TRANSFER_AUTHORIZE_HOST,
+- GLOBUS_NULL);
++ obj = globus_object_construct(GLOBUS_GASS_OBJECT_TYPE_SECURE_REQUESTATTR);
++
++ debug_printf(1, (_GTSL("Exiting %s()\n"),myname));
++ return
++ globus_gass_transfer_secure_requestattr_initialize(
++ obj,
++ GLOBUS_NULL,
++ 0,
++ GLOBUS_GASS_TRANSFER_FILE_MODE_BINARY,
++ GLOBUS_FALSE,
++ 0,
++ 0,
++ GLOBUS_FALSE,
++ GLOBUS_GASS_TRANSFER_AUTHORIZE_HOST,
++ GLOBUS_NULL);
+ }
+ else if(strcmp(url_scheme, "http") == 0)
+ {
+- obj = globus_object_construct(GLOBUS_GASS_OBJECT_TYPE_SOCKET_REQUESTATTR);
++ obj = globus_object_construct(GLOBUS_GASS_OBJECT_TYPE_SOCKET_REQUESTATTR);
+
+- debug_printf(1, (_GTSL("Exiting %s()\n"), myname));
+- return
+- globus_gass_transfer_socket_requestattr_initialize(
+- obj,
+- GLOBUS_NULL,
+- 0,
+- GLOBUS_GASS_TRANSFER_FILE_MODE_BINARY,
+- GLOBUS_FALSE,
+- 0,
+- 0,
+- GLOBUS_FALSE);
++ debug_printf(1, (_GTSL("Exiting %s()\n"), myname));
++ return
++ globus_gass_transfer_socket_requestattr_initialize(
++ obj,
++ GLOBUS_NULL,
++ 0,
++ GLOBUS_GASS_TRANSFER_FILE_MODE_BINARY,
++ GLOBUS_FALSE,
++ 0,
++ 0,
++ GLOBUS_FALSE);
+ }
+ else
+ {
+- debug_printf(1, (_GTSL("Exiting %s()\n"), myname));
+- return GLOBUS_NULL;
++ debug_printf(1, (_GTSL("Exiting %s()\n"), myname));
++ return GLOBUS_NULL;
+ }
+ }
+ /* globus_l_gass_transfer_http_new_requestattr() */
+@@ -2570,26 +2570,26 @@ globus_object_t *
+ globus_l_gass_transfer_http_new_listenerattr(
+ char * url_scheme)
+ {
+- globus_object_t * obj;
++ globus_object_t * obj;
+ MYNAME(globus_l_gass_transfer_http_new_listenerattr);
+-
++
+ debug_printf(1, (_GTSL("Entering %s()\n"), myname));
+ if(strcmp(url_scheme, "https") == 0 ||
+ strcmp(url_scheme, "http") == 0)
+ {
+- obj = globus_object_construct(GLOBUS_GASS_OBJECT_TYPE_LISTENERATTR);
++ obj = globus_object_construct(GLOBUS_GASS_OBJECT_TYPE_LISTENERATTR);
+
+- debug_printf(1, (_GTSL("Exiting %s()\n"),myname));
+- return
+- globus_gass_transfer_listenerattr_initialize(
+- obj,
+- -1,
+- 0);
++ debug_printf(1, (_GTSL("Exiting %s()\n"),myname));
++ return
++ globus_gass_transfer_listenerattr_initialize(
++ obj,
++ -1,
++ 0);
+ }
+ else
+ {
+- debug_printf(1, (_GTSL("Exiting %s()\n"),myname));
+- return GLOBUS_NULL;
++ debug_printf(1, (_GTSL("Exiting %s()\n"),myname));
++ return GLOBUS_NULL;
+ }
+ }
+ /* globus_l_gass_transfer_http_new_listenerattr() */
+@@ -2607,24 +2607,24 @@ globus_l_gass_transfer_http_new_listenerattr(
+ static
+ int
+ globus_l_gass_transfer_http_new_listener(
+- globus_gass_transfer_listener_t listener,
+- globus_gass_transfer_listenerattr_t * attr,
+- char * scheme,
+- char ** base_url,
+- globus_gass_transfer_listener_proto_t ** ret_proto)
++ globus_gass_transfer_listener_t listener,
++ globus_gass_transfer_listenerattr_t * attr,
++ char * scheme,
++ char ** base_url,
++ globus_gass_transfer_listener_proto_t ** ret_proto)
+ {
+ globus_gass_transfer_http_listener_proto_t *
+- proto;
+- globus_io_attr_t tcpattr;
+- globus_io_secure_authorization_data_t data;
+- globus_result_t result;
+- int rc;
+- unsigned short port=0;
+- int backlog=-1;
+- char hostname[MAXHOSTNAMELEN];
+- globus_size_t url_size;
++ proto;
++ globus_io_attr_t tcpattr;
++ globus_io_secure_authorization_data_t data;
++ globus_result_t result;
++ int rc;
++ unsigned short port=0;
++ int backlog=-1;
++ char hostname[MAXHOSTNAMELEN];
++ globus_size_t url_size;
+ MYNAME(globus_l_gass_transfer_http_new_listener);
+-
++
+ debug_printf(1, (_GTSL("Entering %s()\n"),myname));
+ globus_io_tcpattr_init(&tcpattr);
+
+@@ -2632,11 +2632,11 @@ globus_l_gass_transfer_http_new_listener(
+
+ /* Allocate proto instance */
+ proto = (globus_gass_transfer_http_listener_proto_t *)
+- globus_malloc(sizeof(globus_gass_transfer_http_listener_proto_t));
++ globus_malloc(sizeof(globus_gass_transfer_http_listener_proto_t));
+
+ if(proto == GLOBUS_NULL)
+ {
+- goto free_tcpattr;
++ goto free_tcpattr;
+ }
+
+ proto->close_listener = globus_l_gass_transfer_http_close_listener;
+@@ -2648,103 +2648,103 @@ globus_l_gass_transfer_http_new_listener(
+ proto->destroy_called = GLOBUS_FALSE;
+ if(strcmp(scheme, "http") == 0)
+ {
+- proto->url_scheme = GLOBUS_URL_SCHEME_HTTP;
++ proto->url_scheme = GLOBUS_URL_SCHEME_HTTP;
+ }
+ else if(strcmp(scheme, "https") == 0)
+ {
+- result = globus_io_attr_set_secure_authentication_mode(
+- &tcpattr,
+- GLOBUS_IO_SECURE_AUTHENTICATION_MODE_MUTUAL,
+- GLOBUS_NULL);
+- if(result != GLOBUS_SUCCESS)
+- {
+- goto free_proto;
+- }
+-
+- result = globus_io_attr_set_secure_channel_mode(
+- &tcpattr,
+- GLOBUS_IO_SECURE_CHANNEL_MODE_SSL_WRAP);
+-
+- if(result != GLOBUS_SUCCESS)
+- {
+- goto free_proto;
+- }
+- result = globus_io_secure_authorization_data_initialize(&data);
+-
+- if(result != GLOBUS_SUCCESS)
+- {
+- goto free_auth_data;
+- }
+-
+- result = globus_io_secure_authorization_data_set_callback(
+- &data,
+- globus_l_gass_transfer_http_authorization_callback,
+- proto);
+-
+- if(result != GLOBUS_SUCCESS)
+- {
+- goto free_auth_data;
+- }
+-
+- result = globus_io_attr_set_secure_authorization_mode(
+- &tcpattr,
+- GLOBUS_IO_SECURE_AUTHORIZATION_MODE_CALLBACK,
+- &data);
+-
+- if(result != GLOBUS_SUCCESS)
+- {
+- goto free_auth_data;
+- }
+-
+- globus_io_secure_authorization_data_destroy(&data);
+-
+- proto->url_scheme = GLOBUS_URL_SCHEME_HTTPS;
++ result = globus_io_attr_set_secure_authentication_mode(
++ &tcpattr,
++ GLOBUS_IO_SECURE_AUTHENTICATION_MODE_MUTUAL,
++ GLOBUS_NULL);
++ if(result != GLOBUS_SUCCESS)
++ {
++ goto free_proto;
++ }
++
++ result = globus_io_attr_set_secure_channel_mode(
++ &tcpattr,
++ GLOBUS_IO_SECURE_CHANNEL_MODE_SSL_WRAP);
++
++ if(result != GLOBUS_SUCCESS)
++ {
++ goto free_proto;
++ }
++ result = globus_io_secure_authorization_data_initialize(&data);
++
++ if(result != GLOBUS_SUCCESS)
++ {
++ goto free_auth_data;
++ }
++
++ result = globus_io_secure_authorization_data_set_callback(
++ &data,
++ globus_l_gass_transfer_http_authorization_callback,
++ proto);
++
++ if(result != GLOBUS_SUCCESS)
++ {
++ goto free_auth_data;
++ }
++
++ result = globus_io_attr_set_secure_authorization_mode(
++ &tcpattr,
++ GLOBUS_IO_SECURE_AUTHORIZATION_MODE_CALLBACK,
++ &data);
++
++ if(result != GLOBUS_SUCCESS)
++ {
++ goto free_auth_data;
++ }
++
++ globus_io_secure_authorization_data_destroy(&data);
++
++ proto->url_scheme = GLOBUS_URL_SCHEME_HTTPS;
+ }
+ else
+ {
+- goto free_proto;
++ goto free_proto;
+ }
+
+ if(attr)
+ {
+- rc = globus_gass_transfer_listenerattr_get_port(attr,
+- &port);
++ rc = globus_gass_transfer_listenerattr_get_port(attr,
++ &port);
+
+- if(rc != GLOBUS_SUCCESS)
+- {
+- goto free_proto;
+- }
++ if(rc != GLOBUS_SUCCESS)
++ {
++ goto free_proto;
++ }
+
+- rc = globus_gass_transfer_listenerattr_get_backlog(attr,
+- &backlog);
+- if(rc != GLOBUS_SUCCESS)
+- {
+- goto free_proto;
+- }
++ rc = globus_gass_transfer_listenerattr_get_backlog(attr,
++ &backlog);
++ if(rc != GLOBUS_SUCCESS)
++ {
++ goto free_proto;
++ }
+
+ }
+ result = globus_io_tcp_create_listener(&port,
+- backlog,
+- &tcpattr,
+- &proto->handle);
++ backlog,
++ &tcpattr,
++ &proto->handle);
+ globus_io_tcpattr_destroy(&tcpattr);
+ if(result != GLOBUS_SUCCESS)
+ {
+- goto free_proto;
++ goto free_proto;
+ }
+
+ url_size = 15; /* https://:65536\0 */
+ globus_libc_gethostname(hostname,
+- MAXHOSTNAMELEN);
++ MAXHOSTNAMELEN);
+ url_size += strlen(hostname);
+
+ *base_url = globus_malloc(url_size);
+ sprintf(*base_url,
+- "%s://%s:%d",
+- proto->url_scheme == GLOBUS_URL_SCHEME_HTTPS ?
+- "https" : "http",
+- hostname,
+- (int) port);
++ "%s://%s:%d",
++ proto->url_scheme == GLOBUS_URL_SCHEME_HTTPS ?
++ "https" : "http",
++ hostname,
++ (int) port);
+
+
+ proto->state = GLOBUS_GASS_TRANSFER_HTTP_LISTENER_STARTING;
+@@ -2770,7 +2770,7 @@ globus_l_gass_transfer_http_new_listener(
+ * Description: Called by the GASS system when the user has
+ * requested that a listener be closed. This
+ * may be called at any time, but only once
+- * per listener.
++ * per listener.
+ *
+ * Parameters:
+ *
+@@ -2779,55 +2779,55 @@ globus_l_gass_transfer_http_new_listener(
+ static
+ void
+ globus_l_gass_transfer_http_close_listener(
+- globus_gass_transfer_listener_proto_t * proto,
+- globus_gass_transfer_listener_t listener)
++ globus_gass_transfer_listener_proto_t * proto,
++ globus_gass_transfer_listener_t listener)
+ {
+ globus_gass_transfer_http_listener_proto_t *
+- new_proto;
++ new_proto;
+ MYNAME(globus_l_gass_transfer_http_close_listener);
+ debug_printf(1, (_GTSL("entering %s()\n"),myname));
+ new_proto = (globus_gass_transfer_http_listener_proto_t *) proto;
+
+ globus_l_gass_transfer_http_lock();
+ {
+- switch(new_proto->state)
+- {
+- case GLOBUS_GASS_TRANSFER_HTTP_LISTENER_STARTING:
++ switch(new_proto->state)
++ {
++ case GLOBUS_GASS_TRANSFER_HTTP_LISTENER_STARTING:
+ case GLOBUS_GASS_TRANSFER_HTTP_LISTENER_READY:
+- /* If the listener is in the "idle" or "ready" state, then
+- * we can simply register the close, which will free the
+- * proto. (GASS is not waiting for a callback now.
+- */
+- globus_l_gass_transfer_http_register_listener_close(new_proto);
+- break;
++ /* If the listener is in the "idle" or "ready" state, then
++ * we can simply register the close, which will free the
++ * proto. (GASS is not waiting for a callback now.
++ */
++ globus_l_gass_transfer_http_register_listener_close(new_proto);
++ break;
+ case GLOBUS_GASS_TRANSFER_HTTP_LISTENER_LISTENING:
+- /*
+- * If we are in the "listening" state, registering the
+- * close will cause the listen callback to finish, and
+- * after that calls the user, the close callback will delete
+- * things
+- */
+- new_proto->state = GLOBUS_GASS_TRANSFER_HTTP_LISTENER_CLOSING1;
+- globus_l_gass_transfer_http_register_listener_close(new_proto);
+- break;
+- case GLOBUS_GASS_TRANSFER_HTTP_LISTENER_ACCEPTING:
+- /*
+- * If we are in the "accepting" state, registering the
+- * close will cause any outstanding listen callbacks to finish,
+- * from where we can call back to GASS.
+- */
+- new_proto->state = GLOBUS_GASS_TRANSFER_HTTP_LISTENER_CLOSING2;
+- globus_l_gass_transfer_http_register_listener_close(new_proto);
+- break;
+- case GLOBUS_GASS_TRANSFER_HTTP_LISTENER_CLOSING1:
+- case GLOBUS_GASS_TRANSFER_HTTP_LISTENER_CLOSING2:
+- case GLOBUS_GASS_TRANSFER_HTTP_LISTENER_CLOSED:
+- /* should not happen */
+- globus_assert(new_proto->state != GLOBUS_GASS_TRANSFER_HTTP_LISTENER_CLOSING1);
+- globus_assert(new_proto->state != GLOBUS_GASS_TRANSFER_HTTP_LISTENER_CLOSING2);
+- globus_assert(new_proto->state != GLOBUS_GASS_TRANSFER_HTTP_LISTENER_CLOSED);
+- break;
+- }
++ /*
++ * If we are in the "listening" state, registering the
++ * close will cause the listen callback to finish, and
++ * after that calls the user, the close callback will delete
++ * things
++ */
++ new_proto->state = GLOBUS_GASS_TRANSFER_HTTP_LISTENER_CLOSING1;
++ globus_l_gass_transfer_http_register_listener_close(new_proto);
++ break;
++ case GLOBUS_GASS_TRANSFER_HTTP_LISTENER_ACCEPTING:
++ /*
++ * If we are in the "accepting" state, registering the
++ * close will cause any outstanding listen callbacks to finish,
++ * from where we can call back to GASS.
++ */
++ new_proto->state = GLOBUS_GASS_TRANSFER_HTTP_LISTENER_CLOSING2;
++ globus_l_gass_transfer_http_register_listener_close(new_proto);
++ break;
++ case GLOBUS_GASS_TRANSFER_HTTP_LISTENER_CLOSING1:
++ case GLOBUS_GASS_TRANSFER_HTTP_LISTENER_CLOSING2:
++ case GLOBUS_GASS_TRANSFER_HTTP_LISTENER_CLOSED:
++ /* should not happen */
++ globus_assert(new_proto->state != GLOBUS_GASS_TRANSFER_HTTP_LISTENER_CLOSING1);
++ globus_assert(new_proto->state != GLOBUS_GASS_TRANSFER_HTTP_LISTENER_CLOSING2);
++ globus_assert(new_proto->state != GLOBUS_GASS_TRANSFER_HTTP_LISTENER_CLOSED);
++ break;
++ }
+ }
+ globus_l_gass_transfer_http_unlock();
+ debug_printf(1, (_GTSL("exiting %s()\n"),myname));
+@@ -2852,25 +2852,25 @@ globus_l_gass_transfer_http_close_listener(
+ static
+ void
+ globus_l_gass_transfer_http_connect_callback(
+- void * arg,
+- globus_io_handle_t * handle,
+- globus_result_t result)
++ void * arg,
++ globus_io_handle_t * handle,
++ globus_result_t result)
+ {
+- char * cmd;
+- globus_gass_transfer_http_request_proto_t * proto;
+- globus_gass_transfer_request_t request;
+- int code;
+- char * msg;
++ char * cmd;
++ globus_gass_transfer_http_request_proto_t * proto;
++ globus_gass_transfer_request_t request;
++ int code;
++ char * msg;
+ MYNAME(globus_l_gass_transfer_http_connect_callback);
+-
++
+ debug_printf(3, (_GTSL("Entering %s()\n"), myname));
+ /*
+ * In this function, we have completed the TCP (and SSL)
+ * connection protocol, and will send our request to the
+- * server for processing.
++ * server for processing.
+ */
+ proto = (globus_gass_transfer_http_request_proto_t *)
+- arg;
++ arg;
+
+ globus_l_gass_transfer_http_lock();
+
+@@ -2878,38 +2878,38 @@ globus_l_gass_transfer_http_connect_callback(
+
+ if(result != GLOBUS_SUCCESS)
+ {
+- /*
+- * TODO: Evaluate error object here, put into
+- * proto->code and proto->reason
+- */
+- goto deny_exit;
++ /*
++ * TODO: Evaluate error object here, put into
++ * proto->code and proto->reason
++ */
++ goto deny_exit;
+ }
+
+ cmd = globus_l_gass_transfer_http_construct_request(proto);
+
+ if(cmd == GLOBUS_NULL)
+ {
+- goto deny_exit;
++ goto deny_exit;
+ }
+
+ /* Send our command to the server */
+ debug_printf(4,(_GTSL("%s(): Registering write on %p\n"),
+- myname,
+- &proto->handle));
+-
++ myname,
++ &proto->handle));
++
+ result = globus_io_register_write(
+- &proto->handle,
+- (globus_byte_t *) cmd,
+- strlen(cmd) * sizeof(char),
+- globus_l_gass_transfer_http_command_callback,
+- proto);
++ &proto->handle,
++ (globus_byte_t *) cmd,
++ strlen(cmd) * sizeof(char),
++ globus_l_gass_transfer_http_command_callback,
++ proto);
+
+ if(result == GLOBUS_SUCCESS)
+ {
+- proto->state = GLOBUS_GASS_TRANSFER_HTTP_STATE_REQUESTING;
+- globus_l_gass_transfer_http_unlock();
+- debug_printf(3, (_GTSL("Exiting %s()\n"),myname));
+- return;
++ proto->state = GLOBUS_GASS_TRANSFER_HTTP_STATE_REQUESTING;
++ globus_l_gass_transfer_http_unlock();
++ debug_printf(3, (_GTSL("Exiting %s()\n"),myname));
++ return;
+ }
+
+ /* Write registration failed, fall through to deny_exit */
+@@ -2917,8 +2917,8 @@ globus_l_gass_transfer_http_connect_callback(
+ /* Give a default error message, if none is generated above */
+ if(proto->code == 0)
+ {
+- proto->code = GLOBUS_L_DEFAULT_FAILURE_CODE;
+- proto->reason = globus_libc_strdup(GLOBUS_L_DEFAULT_FAILURE_REASON);
++ proto->code = GLOBUS_L_DEFAULT_FAILURE_CODE;
++ proto->reason = globus_libc_strdup(GLOBUS_L_DEFAULT_FAILURE_REASON);
+ }
+
+ /*
+@@ -2944,9 +2944,9 @@ globus_l_gass_transfer_http_connect_callback(
+ /* Signal Denial to the GASS system */
+ debug_printf(2, (_GTSL("calling globus_gass_transfer_proto_request_denied")));
+ globus_gass_transfer_proto_request_denied(
+- request,
+- code,
+- msg);
++ request,
++ code,
++ msg);
+ debug_printf(3, (_GTSL("Exiting %s()\n"),myname));
+ }
+ /* globus_l_gass_transfer_http_connect_callback() */
+@@ -2967,20 +2967,20 @@ globus_l_gass_transfer_http_connect_callback(
+ static
+ void
+ globus_l_gass_transfer_http_command_callback(
+- void * arg,
+- globus_io_handle_t * handle,
+- globus_result_t result,
+- globus_byte_t * buf,
+- globus_size_t nbytes)
++ void * arg,
++ globus_io_handle_t * handle,
++ globus_result_t result,
++ globus_byte_t * buf,
++ globus_size_t nbytes)
+ {
+ globus_gass_transfer_http_request_proto_t * proto;
+- globus_gass_transfer_request_t request;
+- int code;
+- char * reason;
++ globus_gass_transfer_request_t request;
++ int code;
++ char * reason;
+ MYNAME(globus_l_gass_transfer_http_command_callback);
+-
++
+ debug_printf(3, (_GTSL("Entering %s()\n"),myname));
+-
++
+ /*
+ * In this function, we have completed sending our request
+ * to the server. If there was some sort of error, we
+@@ -2994,7 +2994,7 @@ globus_l_gass_transfer_http_command_callback(
+
+ if(result != GLOBUS_SUCCESS)
+ {
+- goto deny_exit;
++ goto deny_exit;
+ }
+ /*
+ * Free the request command buffer.
+@@ -3007,7 +3007,7 @@ globus_l_gass_transfer_http_command_callback(
+ * The buffer may have to grow if there are a lot of headers.
+ */
+ proto->response_buffer = globus_malloc(GLOBUS_L_GASS_RESPONSE_LEN *
+- sizeof(globus_byte_t));
++ sizeof(globus_byte_t));
+ proto->response_buflen = GLOBUS_L_GASS_RESPONSE_LEN;
+ proto->response_offset = 0;
+ proto->parsed_offset = 0;
+@@ -3016,68 +3016,68 @@ globus_l_gass_transfer_http_command_callback(
+ {
+ case GLOBUS_GASS_TRANSFER_REQUEST_TYPE_PUT:
+ case GLOBUS_GASS_TRANSFER_REQUEST_TYPE_APPEND:
+- /*
+- * If we are a "put" or "append" request, then we can start
+- * sending data sort of immediately. So we send an "ready"
+- * message to the server. A little optimistic, perhaps...
+- * We will not register for the response message until
+- * we've sent the last data.
+- */
+- proto->state = GLOBUS_GASS_TRANSFER_HTTP_STATE_IDLE;
+-
+- debug_printf(4,(_GTSL("%s(): Registering read on %p\n"),
+- myname,
+- &proto->handle));
+-
+- result = globus_io_register_read(
+- &proto->handle,
+- proto->response_buffer,
+- proto->response_buflen,
+- 1,
+- globus_l_gass_transfer_http_response_callback,
+- proto);
+- if(result != GLOBUS_SUCCESS)
+- {
+- proto->failure_occurred = GLOBUS_TRUE;
+- }
+- globus_l_gass_transfer_http_unlock();
+-
+- debug_printf(2, (_GTSL("calling globus_gass_transfer_proto_request_ready")));
++ /*
++ * If we are a "put" or "append" request, then we can start
++ * sending data sort of immediately. So we send an "ready"
++ * message to the server. A little optimistic, perhaps...
++ * We will not register for the response message until
++ * we've sent the last data.
++ */
++ proto->state = GLOBUS_GASS_TRANSFER_HTTP_STATE_IDLE;
++
++ debug_printf(4,(_GTSL("%s(): Registering read on %p\n"),
++ myname,
++ &proto->handle));
++
++ result = globus_io_register_read(
++ &proto->handle,
++ proto->response_buffer,
++ proto->response_buflen,
++ 1,
++ globus_l_gass_transfer_http_response_callback,
++ proto);
++ if(result != GLOBUS_SUCCESS)
++ {
++ proto->failure_occurred = GLOBUS_TRUE;
++ }
++ globus_l_gass_transfer_http_unlock();
++
++ debug_printf(2, (_GTSL("calling globus_gass_transfer_proto_request_ready")));
+
+ globus_gass_transfer_proto_request_ready(
+- proto->request,
+- (globus_gass_transfer_request_proto_t *) proto);
++ proto->request,
++ (globus_gass_transfer_request_proto_t *) proto);
+
+
+ debug_printf(3, (_GTSL("Exiting %s()\n"),myname));
+- return;
++ return;
+ case GLOBUS_GASS_TRANSFER_REQUEST_TYPE_GET:
+- /*
+- * If we are a "GET" request we can't do anything
+- * until the server sends us some info, anyway
+- */
+- debug_printf(4,(_GTSL("%s(): Registering read on %p\n"),
+- myname,
+- &proto->handle));
+- result = globus_io_register_read(
+- &proto->handle,
+- proto->response_buffer,
+- proto->response_buflen,
+- 1,
+- globus_l_gass_transfer_http_response_callback,
+- proto);
+- if(result != GLOBUS_SUCCESS)
+- {
+- /* should interpret the error object */
+- goto deny_exit;
+- }
+- globus_l_gass_transfer_http_unlock();
++ /*
++ * If we are a "GET" request we can't do anything
++ * until the server sends us some info, anyway
++ */
++ debug_printf(4,(_GTSL("%s(): Registering read on %p\n"),
++ myname,
++ &proto->handle));
++ result = globus_io_register_read(
++ &proto->handle,
++ proto->response_buffer,
++ proto->response_buflen,
++ 1,
++ globus_l_gass_transfer_http_response_callback,
++ proto);
++ if(result != GLOBUS_SUCCESS)
++ {
++ /* should interpret the error object */
++ goto deny_exit;
++ }
++ globus_l_gass_transfer_http_unlock();
+ debug_printf(3, (_GTSL("Exiting %s()\n"),myname));
+- return;
++ return;
+ default:
+- globus_assert(proto->type !=
+- GLOBUS_GASS_TRANSFER_REQUEST_TYPE_INVALID);
+- goto deny_exit;
++ globus_assert(proto->type !=
++ GLOBUS_GASS_TRANSFER_REQUEST_TYPE_INVALID);
++ goto deny_exit;
+ }
+
+ deny_exit:
+@@ -3089,13 +3089,13 @@ globus_l_gass_transfer_http_command_callback(
+ /* Give a default error message, if none is generated above */
+ if(proto->code == 0)
+ {
+- proto->code = GLOBUS_L_DEFAULT_FAILURE_CODE;
+- proto->reason = globus_libc_strdup(GLOBUS_L_DEFAULT_FAILURE_REASON);
++ proto->code = GLOBUS_L_DEFAULT_FAILURE_CODE;
++ proto->reason = globus_libc_strdup(GLOBUS_L_DEFAULT_FAILURE_REASON);
+ }
+
+ request = proto->request;
+ code = proto->code;
+- reason = globus_libc_strdup(proto->reason);
++ reason = globus_libc_strdup(proto->reason);
+
+ result = globus_l_gass_transfer_http_register_close(proto);
+
+@@ -3103,15 +3103,15 @@ globus_l_gass_transfer_http_command_callback(
+ {
+ globus_l_gass_transfer_http_close(proto);
+ }
+-
++
+ globus_l_gass_transfer_http_unlock();
+
+ /* Signal Denial to the GASS system */
+ debug_printf(2, (_GTSL("calling globus_gass_transfer_proto_request_denied")));
+ globus_gass_transfer_proto_request_denied(
+- request,
+- code,
+- reason);
++ request,
++ code,
++ reason);
+ debug_printf(3, (_GTSL("Exiting %s()\n"),myname));
+ }
+ /* globus_l_gass_transfer_http_command_callback() */
+@@ -3119,15 +3119,15 @@ globus_l_gass_transfer_http_command_callback(
+ static
+ void
+ globus_l_gass_transfer_http_response_callback(
+- void * arg,
+- globus_io_handle_t * handle,
+- globus_result_t result,
+- globus_byte_t * buf,
+- globus_size_t nbytes)
++ void * arg,
++ globus_io_handle_t * handle,
++ globus_result_t result,
++ globus_byte_t * buf,
++ globus_size_t nbytes)
+ {
+- globus_gass_transfer_http_request_proto_t * proto;
+- globus_object_t * err=GLOBUS_NULL;
+- globus_gass_transfer_request_t request;
++ globus_gass_transfer_http_request_proto_t * proto;
++ globus_object_t * err=GLOBUS_NULL;
++ globus_gass_transfer_request_t request;
+ int code;
+ char * reason;
+ MYNAME(globus_l_gass_transfer_http_response_callback);
+@@ -3138,10 +3138,10 @@ globus_l_gass_transfer_http_response_callback(
+ {
+ char * tmpstr;
+
+- err = globus_error_get(result);
+- tmpstr = globus_object_printable_to_string(err);
+- debug_printf(5, (_GTSL("globus_l_gass_transfer_http_read_callback(): %s"), tmpstr));
+- globus_libc_free(tmpstr);
++ err = globus_error_get(result);
++ tmpstr = globus_object_printable_to_string(err);
++ debug_printf(5, (_GTSL("globus_l_gass_transfer_http_read_callback(): %s"), tmpstr));
++ globus_libc_free(tmpstr);
+ }
+
+ globus_l_gass_transfer_http_lock();
+@@ -3151,13 +3151,13 @@ globus_l_gass_transfer_http_response_callback(
+ if(result != GLOBUS_SUCCESS &&
+ !globus_io_eof(err))
+ {
+- if(proto->type == GLOBUS_GASS_TRANSFER_REQUEST_TYPE_PUT ||
+- proto->type == GLOBUS_GASS_TRANSFER_REQUEST_TYPE_APPEND)
+- {
+- goto put_fail_exit;
+- }
++ if(proto->type == GLOBUS_GASS_TRANSFER_REQUEST_TYPE_PUT ||
++ proto->type == GLOBUS_GASS_TRANSFER_REQUEST_TYPE_APPEND)
++ {
++ goto put_fail_exit;
++ }
+
+- result = globus_l_gass_transfer_http_register_close(proto);
++ result = globus_l_gass_transfer_http_register_close(proto);
+
+ if (result != GLOBUS_SUCCESS)
+ {
+@@ -3165,22 +3165,22 @@ globus_l_gass_transfer_http_response_callback(
+ }
+
+
+- globus_l_gass_transfer_http_unlock();
++ globus_l_gass_transfer_http_unlock();
+
+- /* TODO: Evaluate error object, or response from the server here */
+- debug_printf(2, (_GTSL("calling globus_gass_transfer_proto_request_denied")));
+- globus_gass_transfer_proto_request_denied(
+- request,
+- GLOBUS_L_DEFAULT_FAILURE_CODE,
+- globus_libc_strdup(GLOBUS_L_DEFAULT_FAILURE_REASON));
++ /* TODO: Evaluate error object, or response from the server here */
++ debug_printf(2, (_GTSL("calling globus_gass_transfer_proto_request_denied")));
++ globus_gass_transfer_proto_request_denied(
++ request,
++ GLOBUS_L_DEFAULT_FAILURE_CODE,
++ globus_libc_strdup(GLOBUS_L_DEFAULT_FAILURE_REASON));
+
+- if(err)
+- {
+- globus_object_free(err);
+- }
++ if(err)
++ {
++ globus_object_free(err);
++ }
+
+- debug_printf(3, (_GTSL("Exiting globus_l_gass_transfer_http_response_callback()\n")));
+- return;
++ debug_printf(3, (_GTSL("Exiting globus_l_gass_transfer_http_response_callback()\n")));
++ return;
+ }
+
+ /* Update our counters */
+@@ -3188,418 +3188,418 @@ globus_l_gass_transfer_http_response_callback(
+
+ do
+ {
+- /* Parse the buffer that we have */
+- if(globus_l_gass_transfer_http_parse_response(proto))
+- {
+- /* returns true, if we need to read some more */
+- goto repost_read;
+- }
+-
+- switch(proto->type)
+- {
+- case GLOBUS_GASS_TRANSFER_REQUEST_TYPE_GET:
+- /* If it is a GET request, we need an affirmative
+- * response, or a continue, or a referral
+- */
+- if(proto->code < 100 ||
+- proto->code >= 400)
+- {
+- /* Denied */
+- goto deny_exit;
+- }
+- else if(proto->code >= 100 &&
+- proto->code < 200)
+- {
+- /*
+- * Continue... Reset our response buffers,
+- * and get another set of headers
+- */
+- memmove(proto->response_buffer,
+- proto->response_buffer + proto->parsed_offset,
+- proto->response_offset - proto->parsed_offset);
+-
+- proto->response_offset -= proto->parsed_offset;
+- proto->parsed_offset = 0;
+-
+- if(proto->reason)
+- {
+- globus_free(proto->reason);
+- }
+- proto->code = 0;
+- proto->reason = GLOBUS_NULL;
+-
+- globus_i_gass_transfer_keyvalue_destroy(
+- &proto->headers);
+-
+- /*
+- * There may be more headers in our buffer, so
+- * we should go through the parse loop again,
+- * maybe
+- */
+- if(proto->response_offset != 0)
+- {
+- continue;
+- }
+- else
+- {
+- goto repost_read;
+- }
+- }
+- else if(proto->code >= 300 &&
+- proto->code < 400)
+- {
+- char ** referral;
+- globus_size_t referral_count;
+- /* We've got a referral from the server */
+- globus_l_gass_transfer_http_extract_referral(proto,
+- &referral,
+- &referral_count);
+-
+- if(referral == GLOBUS_NULL)
+- {
+- goto deny_exit;
+- }
+- else
+- {
+- /* If this is a get request, then the proto layer
+- * doesn't have a pointer to this proto yet,
+- * so we need to act like they've destroyed their
+- * reference to it
+- */
+- proto->destroy_called = GLOBUS_TRUE;
+- result = globus_l_gass_transfer_http_register_close(proto);
++ /* Parse the buffer that we have */
++ if(globus_l_gass_transfer_http_parse_response(proto))
++ {
++ /* returns true, if we need to read some more */
++ goto repost_read;
++ }
++
++ switch(proto->type)
++ {
++ case GLOBUS_GASS_TRANSFER_REQUEST_TYPE_GET:
++ /* If it is a GET request, we need an affirmative
++ * response, or a continue, or a referral
++ */
++ if(proto->code < 100 ||
++ proto->code >= 400)
++ {
++ /* Denied */
++ goto deny_exit;
++ }
++ else if(proto->code >= 100 &&
++ proto->code < 200)
++ {
++ /*
++ * Continue... Reset our response buffers,
++ * and get another set of headers
++ */
++ memmove(proto->response_buffer,
++ proto->response_buffer + proto->parsed_offset,
++ proto->response_offset - proto->parsed_offset);
++
++ proto->response_offset -= proto->parsed_offset;
++ proto->parsed_offset = 0;
++
++ if(proto->reason)
++ {
++ globus_free(proto->reason);
++ }
++ proto->code = 0;
++ proto->reason = GLOBUS_NULL;
++
++ globus_i_gass_transfer_keyvalue_destroy(
++ &proto->headers);
++
++ /*
++ * There may be more headers in our buffer, so
++ * we should go through the parse loop again,
++ * maybe
++ */
++ if(proto->response_offset != 0)
++ {
++ continue;
++ }
++ else
++ {
++ goto repost_read;
++ }
++ }
++ else if(proto->code >= 300 &&
++ proto->code < 400)
++ {
++ char ** referral;
++ globus_size_t referral_count;
++ /* We've got a referral from the server */
++ globus_l_gass_transfer_http_extract_referral(proto,
++ &referral,
++ &referral_count);
++
++ if(referral == GLOBUS_NULL)
++ {
++ goto deny_exit;
++ }
++ else
++ {
++ /* If this is a get request, then the proto layer
++ * doesn't have a pointer to this proto yet,
++ * so we need to act like they've destroyed their
++ * reference to it
++ */
++ proto->destroy_called = GLOBUS_TRUE;
++ result = globus_l_gass_transfer_http_register_close(proto);
+ if (result != GLOBUS_SUCCESS)
+ {
+ globus_l_gass_transfer_http_close(proto);
+ }
+-
+- globus_l_gass_transfer_http_unlock();
+- debug_printf(2, (_GTSL("calling globus_gass_transfer_proto_request_referred")));
+- globus_gass_transfer_proto_request_referred(
+- request,
+- referral,
+- referral_count);
+- return;
+- }
+- }
+- else
+- {
+- /*
+- * Successful response for the "get", check for
+- * interesting headers, and indicate "ready" to
+- * the GASS system. (note that first read will
+- * have to deal with the data in
+- * proto->response_buffer)
+- */
+- char * value;
+-
+- /*
+- * Look to see if there are any headers we
+- * care about
+- */
+- value = globus_i_gass_transfer_keyvalue_lookup(
+- &proto->headers,
+- "transfer-encoding");
+- if(value)
+- {
+- char * tmp;
+-
+- for(tmp = value; *tmp != '\0'; tmp++)
+- {
+- if(! isspace(*tmp))
+- {
+- break;
+- }
+- }
++
++ globus_l_gass_transfer_http_unlock();
++ debug_printf(2, (_GTSL("calling globus_gass_transfer_proto_request_referred")));
++ globus_gass_transfer_proto_request_referred(
++ request,
++ referral,
++ referral_count);
++ return;
++ }
++ }
++ else
++ {
++ /*
++ * Successful response for the "get", check for
++ * interesting headers, and indicate "ready" to
++ * the GASS system. (note that first read will
++ * have to deal with the data in
++ * proto->response_buffer)
++ */
++ char * value;
++
++ /*
++ * Look to see if there are any headers we
++ * care about
++ */
++ value = globus_i_gass_transfer_keyvalue_lookup(
++ &proto->headers,
++ "transfer-encoding");
++ if(value)
++ {
++ char * tmp;
++
++ for(tmp = value; *tmp != '\0'; tmp++)
++ {
++ if(! isspace(*tmp))
++ {
++ break;
++ }
++ }
+ #ifndef TARGET_ARCH_WIN32
+- if(strncasecmp(tmp, "chunked", strlen("chunked")) == 0)
++ if(strncasecmp(tmp, "chunked", strlen("chunked")) == 0)
+ #else
+- if(strnicmp(tmp, "chunked", strlen("chunked")) == 0)
++ if(strnicmp(tmp, "chunked", strlen("chunked")) == 0)
+ #endif
+- {
+- proto->recv_buffer =
+- globus_l_gass_transfer_http_receive;
+- proto->chunked = GLOBUS_TRUE;
+- proto->recv_state =
+- GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_CHUNK_SIZE;
+- proto->length = 0;
+- }
+- }
+- if(!proto->chunked)
+- {
+- /* If both
+- * Transfer-Encoding: chunked and
+- * Content-Length: <something>
+- * are passed, the Content-length should be ignored,
+- * according to RFC 2068
+- */
+- value = globus_i_gass_transfer_keyvalue_lookup(
+- &proto->headers,
+- "content-length");
+-
+- if(value)
+- {
+- int save_errno;
+- char * tmp;
+-
+- for(tmp = value; *tmp != '\0'; tmp++)
+- {
+- if(! isspace(*tmp))
+- {
+- break;
+- }
+- }
+- globus_libc_lock();
+- errno=0;
+- proto->length = strtoul(tmp,
+- GLOBUS_NULL,
+- 10);
+- save_errno=errno;
+- globus_libc_unlock();
+- if(save_errno != 0)
+- {
+- proto->code = GLOBUS_L_PROTOCOL_FAILURE_CODE;
+- proto->reason = globus_libc_strdup(
+- GLOBUS_L_PROTOCOL_FAILURE_REASON);
+- goto deny_exit;
+- }
+- if(proto->length == 0)
+- {
+- proto->recv_state =
+- GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_ERROR;
+- }
+- else
+- {
+- proto->recv_state =
+- GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_UNTIL_LENGTH;
+- }
+- }
+- else
+- {
+- proto->recv_state =
+- GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_UNTIL_EOF;
+- }
+-
+- if(!proto->text_mode)
+- {
+- globus_gass_transfer_request_set_length(proto->request,
+- proto->length);
+-
+- }
+- }
+- /*
+- * The response buffer's residue may contain some
+- * entity information, so let's keep it around.
+- * Also, if we are in text mode, we'll have to copy
+- * the data anyway (but should use the block_size)
+- */
+-
+- if(proto->text_mode &&
+- proto->block_size > proto->response_buflen)
+- {
+- globus_byte_t * tmp;
+-
+- tmp = globus_libc_realloc(proto->response_buffer,
+- proto->block_size *
+- sizeof(globus_byte_t));
+- if(tmp != GLOBUS_NULL)
+- {
+- proto->response_buffer = tmp;
+- proto->response_buflen = proto->block_size;
+- }
+-
+- }
+-
+- proto->state = GLOBUS_GASS_TRANSFER_HTTP_STATE_IDLE;
+- globus_l_gass_transfer_http_unlock();
+-
+- debug_printf(2, (_GTSL("calling globus_gass_transfer_proto_request_ready"))); globus_gass_transfer_proto_request_ready(
+- proto->request,
+- (globus_gass_transfer_request_proto_t *) proto);
+- }
+- break;
+- case GLOBUS_GASS_TRANSFER_REQUEST_TYPE_PUT:
+- case GLOBUS_GASS_TRANSFER_REQUEST_TYPE_APPEND:
+- /* If it is a PUT or APPEND request, we don't expect any
+- * response from the server until we're done sending,
+- * or the server kills our request
+- */
+- if(proto->code < 100 ||
+- proto->code >= 400)
+- {
+- /* Request failed. */
+- goto put_fail_exit;
+- }
+- else if(proto->code >= 300 &&
+- proto->code < 400)
+- {
+- char ** referral;
+- globus_size_t referral_count;
+- /* Request referred. */
+- globus_l_gass_transfer_http_extract_referral(proto,
+- &referral,
+- &referral_count);
+- if(referral == GLOBUS_NULL)
+- {
+- goto put_fail_exit;
+- }
+- else if(proto->state == GLOBUS_GASS_TRANSFER_HTTP_STATE_IDLE)
+- {
+- result = globus_l_gass_transfer_http_register_close(proto);
++ {
++ proto->recv_buffer =
++ globus_l_gass_transfer_http_receive;
++ proto->chunked = GLOBUS_TRUE;
++ proto->recv_state =
++ GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_CHUNK_SIZE;
++ proto->length = 0;
++ }
++ }
++ if(!proto->chunked)
++ {
++ /* If both
++ * Transfer-Encoding: chunked and
++ * Content-Length: <something>
++ * are passed, the Content-length should be ignored,
++ * according to RFC 2068
++ */
++ value = globus_i_gass_transfer_keyvalue_lookup(
++ &proto->headers,
++ "content-length");
++
++ if(value)
++ {
++ int save_errno;
++ char * tmp;
++
++ for(tmp = value; *tmp != '\0'; tmp++)
++ {
++ if(! isspace(*tmp))
++ {
++ break;
++ }
++ }
++ globus_libc_lock();
++ errno=0;
++ proto->length = strtoul(tmp,
++ GLOBUS_NULL,
++ 10);
++ save_errno=errno;
++ globus_libc_unlock();
++ if(save_errno != 0)
++ {
++ proto->code = GLOBUS_L_PROTOCOL_FAILURE_CODE;
++ proto->reason = globus_libc_strdup(
++ GLOBUS_L_PROTOCOL_FAILURE_REASON);
++ goto deny_exit;
++ }
++ if(proto->length == 0)
++ {
++ proto->recv_state =
++ GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_ERROR;
++ }
++ else
++ {
++ proto->recv_state =
++ GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_UNTIL_LENGTH;
++ }
++ }
++ else
++ {
++ proto->recv_state =
++ GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_UNTIL_EOF;
++ }
++
++ if(!proto->text_mode)
++ {
++ globus_gass_transfer_request_set_length(proto->request,
++ proto->length);
++
++ }
++ }
++ /*
++ * The response buffer's residue may contain some
++ * entity information, so let's keep it around.
++ * Also, if we are in text mode, we'll have to copy
++ * the data anyway (but should use the block_size)
++ */
++
++ if(proto->text_mode &&
++ proto->block_size > proto->response_buflen)
++ {
++ globus_byte_t * tmp;
++
++ tmp = globus_libc_realloc(proto->response_buffer,
++ proto->block_size *
++ sizeof(globus_byte_t));
++ if(tmp != GLOBUS_NULL)
++ {
++ proto->response_buffer = tmp;
++ proto->response_buflen = proto->block_size;
++ }
++
++ }
++
++ proto->state = GLOBUS_GASS_TRANSFER_HTTP_STATE_IDLE;
++ globus_l_gass_transfer_http_unlock();
++
++ debug_printf(2, (_GTSL("calling globus_gass_transfer_proto_request_ready"))); globus_gass_transfer_proto_request_ready(
++ proto->request,
++ (globus_gass_transfer_request_proto_t *) proto);
++ }
++ break;
++ case GLOBUS_GASS_TRANSFER_REQUEST_TYPE_PUT:
++ case GLOBUS_GASS_TRANSFER_REQUEST_TYPE_APPEND:
++ /* If it is a PUT or APPEND request, we don't expect any
++ * response from the server until we're done sending,
++ * or the server kills our request
++ */
++ if(proto->code < 100 ||
++ proto->code >= 400)
++ {
++ /* Request failed. */
++ goto put_fail_exit;
++ }
++ else if(proto->code >= 300 &&
++ proto->code < 400)
++ {
++ char ** referral;
++ globus_size_t referral_count;
++ /* Request referred. */
++ globus_l_gass_transfer_http_extract_referral(proto,
++ &referral,
++ &referral_count);
++ if(referral == GLOBUS_NULL)
++ {
++ goto put_fail_exit;
++ }
++ else if(proto->state == GLOBUS_GASS_TRANSFER_HTTP_STATE_IDLE)
++ {
++ result = globus_l_gass_transfer_http_register_close(proto);
+ if (result != GLOBUS_SUCCESS)
+ {
+ globus_l_gass_transfer_http_close(proto);
+ }
+-
+- globus_l_gass_transfer_http_unlock();
+- debug_printf(2, (_GTSL("calling globus_gass_transfer_proto_request_referred")));
+- globus_gass_transfer_proto_request_referred(request,
+- referral,
+- referral_count);
+- debug_printf(3, (_GTSL("Exiting globus_l_gass_transfer_http_response_callback()\n")));
+- return;
+- }
+- else
+- {
+- proto->failure_occurred = GLOBUS_TRUE;
+-
+- result = globus_l_gass_transfer_http_register_close(proto);
++
++ globus_l_gass_transfer_http_unlock();
++ debug_printf(2, (_GTSL("calling globus_gass_transfer_proto_request_referred")));
++ globus_gass_transfer_proto_request_referred(request,
++ referral,
++ referral_count);
++ debug_printf(3, (_GTSL("Exiting globus_l_gass_transfer_http_response_callback()\n")));
++ return;
++ }
++ else
++ {
++ proto->failure_occurred = GLOBUS_TRUE;
++
++ result = globus_l_gass_transfer_http_register_close(proto);
+ if (result != GLOBUS_SUCCESS)
+ {
+ globus_l_gass_transfer_http_close(proto);
+ }
+-
+- globus_l_gass_transfer_http_unlock();
+-
+- debug_printf(2, (_GTSL("calling globus_gass_transfer_proto_request_referred")));
+- globus_gass_transfer_proto_request_referred(request,
+- referral,
+- referral_count);
+-
+- debug_printf(3, (_GTSL("Exiting globus_l_gass_transfer_http_response_callback()\n")));
+- return;
+- }
+- }
+- else if(proto->code >= 100 &&
+- proto->code < 200)
+- {
+- /*
+- * Continue... Reset our response buffers,
+- * and get another set of headers
+- */
+- memmove(proto->response_buffer,
+- proto->response_buffer + proto->parsed_offset,
+- proto->response_offset - proto->parsed_offset);
+-
+- proto->response_offset -= proto->parsed_offset;
+- proto->parsed_offset = 0;
+-
+- if(proto->reason)
+- {
+- globus_free(proto->reason);
+- }
+- proto->code = 0;
+- proto->reason = GLOBUS_NULL;
+-
+- globus_i_gass_transfer_keyvalue_destroy(
+- &proto->headers);
+-
+- /*
+- * There may be more headers in our buffer, so
+- * we should go through the parse loop again,
+- * maybe
+- */
+- if(proto->response_offset != 0)
+- {
+- continue;
+- }
+- else
+- {
+- goto repost_read;
+- }
+- }
+- else
+- {
+- goto put_success_exit;
+- }
+- case GLOBUS_GASS_TRANSFER_REQUEST_TYPE_INVALID:
+- default:
+- globus_assert(proto->type !=
+- GLOBUS_GASS_TRANSFER_REQUEST_TYPE_INVALID);
+- globus_assert(GLOBUS_FALSE);
+- debug_printf(3, (_GTSL("Exiting globus_l_gass_transfer_http_response_callback()\n")));
+- return;
+- }
++
++ globus_l_gass_transfer_http_unlock();
++
++ debug_printf(2, (_GTSL("calling globus_gass_transfer_proto_request_referred")));
++ globus_gass_transfer_proto_request_referred(request,
++ referral,
++ referral_count);
++
++ debug_printf(3, (_GTSL("Exiting globus_l_gass_transfer_http_response_callback()\n")));
++ return;
++ }
++ }
++ else if(proto->code >= 100 &&
++ proto->code < 200)
++ {
++ /*
++ * Continue... Reset our response buffers,
++ * and get another set of headers
++ */
++ memmove(proto->response_buffer,
++ proto->response_buffer + proto->parsed_offset,
++ proto->response_offset - proto->parsed_offset);
++
++ proto->response_offset -= proto->parsed_offset;
++ proto->parsed_offset = 0;
++
++ if(proto->reason)
++ {
++ globus_free(proto->reason);
++ }
++ proto->code = 0;
++ proto->reason = GLOBUS_NULL;
++
++ globus_i_gass_transfer_keyvalue_destroy(
++ &proto->headers);
++
++ /*
++ * There may be more headers in our buffer, so
++ * we should go through the parse loop again,
++ * maybe
++ */
++ if(proto->response_offset != 0)
++ {
++ continue;
++ }
++ else
++ {
++ goto repost_read;
++ }
++ }
++ else
++ {
++ goto put_success_exit;
++ }
++ case GLOBUS_GASS_TRANSFER_REQUEST_TYPE_INVALID:
++ default:
++ globus_assert(proto->type !=
++ GLOBUS_GASS_TRANSFER_REQUEST_TYPE_INVALID);
++ globus_assert(GLOBUS_FALSE);
++ debug_printf(3, (_GTSL("Exiting globus_l_gass_transfer_http_response_callback()\n")));
++ return;
++ }
+ }
+ while(proto->code == 0 ||
+- proto->code == 100);
+- debug_printf(3, (_GTSL("Exiting globus_l_gass_transfer_http_response_callback()\n")));
++ proto->code == 100);
++ debug_printf(3, (_GTSL("Exiting globus_l_gass_transfer_http_response_callback()\n")));
+ return;
+
+ repost_read:
+ if(result != GLOBUS_SUCCESS)
+ {
+- proto->code = GLOBUS_L_DEFAULT_FAILURE_CODE;
+- proto->reason = globus_libc_strdup(GLOBUS_L_DEFAULT_FAILURE_REASON);
+- if(proto->type == GLOBUS_GASS_TRANSFER_REQUEST_TYPE_PUT ||
+- proto->type == GLOBUS_GASS_TRANSFER_REQUEST_TYPE_APPEND)
++ proto->code = GLOBUS_L_DEFAULT_FAILURE_CODE;
++ proto->reason = globus_libc_strdup(GLOBUS_L_DEFAULT_FAILURE_REASON);
++ if(proto->type == GLOBUS_GASS_TRANSFER_REQUEST_TYPE_PUT ||
++ proto->type == GLOBUS_GASS_TRANSFER_REQUEST_TYPE_APPEND)
++ {
++ goto put_fail_exit;
++ }
++ else
+ {
+- goto put_fail_exit;
+- }
+- else
+- {
+- goto deny_exit;
+- }
++ goto deny_exit;
++ }
+ }
+
+ /* Reallocate a larger buffer, if we need to */
+ if(proto->response_buflen == proto->response_offset)
+ {
+- globus_byte_t * tmp;
+- tmp = globus_libc_realloc(proto->response_buffer,
+- proto->response_buflen *
+- 2 *
+- sizeof(globus_byte_t));
+- if(tmp == GLOBUS_NULL)
+- {
+- proto->code = GLOBUS_L_MALLOC_FAILURE_CODE;
+- proto->reason = globus_libc_strdup(GLOBUS_L_MALLOC_FAILURE_REASON);
+-
+- goto deny_exit;
+- }
+- else
+- {
+- proto->response_buffer = tmp;
+- proto->response_buflen *= 2;
+- }
++ globus_byte_t * tmp;
++ tmp = globus_libc_realloc(proto->response_buffer,
++ proto->response_buflen *
++ 2 *
++ sizeof(globus_byte_t));
++ if(tmp == GLOBUS_NULL)
++ {
++ proto->code = GLOBUS_L_MALLOC_FAILURE_CODE;
++ proto->reason = globus_libc_strdup(GLOBUS_L_MALLOC_FAILURE_REASON);
++
++ goto deny_exit;
++ }
++ else
++ {
++ proto->response_buffer = tmp;
++ proto->response_buflen *= 2;
++ }
+ }
+
+ /* Register another read */
+ debug_printf(4,(_GTSL("%s(): Registering read on %p\n"),
+- myname,
+- &proto->handle));
++ myname,
++ &proto->handle));
+ result = globus_io_register_read(&proto->handle,
+- proto->response_buffer +
+- proto->response_offset,
+- proto->response_buflen -
+- proto->response_offset,
+- 1,
+- globus_l_gass_transfer_http_response_callback,
+- proto);
++ proto->response_buffer +
++ proto->response_offset,
++ proto->response_buflen -
++ proto->response_offset,
++ 1,
++ globus_l_gass_transfer_http_response_callback,
++ proto);
+ if(result != GLOBUS_SUCCESS)
+ {
+- /* TODO interpret the error object */
+- goto deny_exit;
++ /* TODO interpret the error object */
++ goto deny_exit;
+ }
+ globus_l_gass_transfer_http_unlock();
+
+- debug_printf(3, (_GTSL("Exiting globus_l_gass_transfer_http_response_callback()\n")));
++ debug_printf(3, (_GTSL("Exiting globus_l_gass_transfer_http_response_callback()\n")));
+ return;
+
+ deny_exit:
+ if(err)
+ {
+- globus_object_free(err);
++ globus_object_free(err);
+ }
+
+ /*
+@@ -3617,50 +3617,50 @@ globus_l_gass_transfer_http_response_callback(
+ {
+ globus_l_gass_transfer_http_close(proto);
+ }
+-
++
+ globus_l_gass_transfer_http_unlock();
+
+ debug_printf(2, (_GTSL("calling globus_gass_transfer_proto_request_denied")));
+ globus_gass_transfer_proto_request_denied(request,
+- code,
+- reason);
+- debug_printf(3, (_GTSL("Exiting globus_l_gass_transfer_http_response_callback()\n")));
++ code,
++ reason);
++ debug_printf(3, (_GTSL("Exiting globus_l_gass_transfer_http_response_callback()\n")));
+ return;
+
+ put_success_exit:
+ {
+- globus_byte_t * buffer;
+- globus_size_t offset;
+- globus_bool_t failure;
++ globus_byte_t * buffer;
++ globus_size_t offset;
++ globus_bool_t failure;
++
+
++ buffer = proto->user_buffer;
++ offset = proto->user_offset;
++ failure = proto->failure_occurred;
+
+- buffer = proto->user_buffer;
+- offset = proto->user_offset;
+- failure = proto->failure_occurred;
+-
+- /*
+- * success response from a server, signal this to the GASS system
+- */
+- globus_assert(proto->state == GLOBUS_GASS_TRANSFER_HTTP_STATE_PENDING);
+- result = globus_l_gass_transfer_http_register_close(proto);
++ /*
++ * success response from a server, signal this to the GASS system
++ */
++ globus_assert(proto->state == GLOBUS_GASS_TRANSFER_HTTP_STATE_PENDING);
++ result = globus_l_gass_transfer_http_register_close(proto);
+ if (result != GLOBUS_SUCCESS)
+ {
+ globus_l_gass_transfer_http_close(proto);
+ }
+-
+- globus_l_gass_transfer_http_unlock();
+- debug_printf(2, (_GTSL("calling globus_gass_transfer_proto_send_complete()")));
+- globus_gass_transfer_proto_send_complete(request,
+- buffer,
+- offset,
+- failure,
+- GLOBUS_TRUE);
+
+- debug_printf(3, (_GTSL("Exiting globus_l_gass_transfer_http_response_callback()\n")));
+- return;
++ globus_l_gass_transfer_http_unlock();
++ debug_printf(2, (_GTSL("calling globus_gass_transfer_proto_send_complete()")));
++ globus_gass_transfer_proto_send_complete(request,
++ buffer,
++ offset,
++ failure,
++ GLOBUS_TRUE);
++
++ debug_printf(3, (_GTSL("Exiting globus_l_gass_transfer_http_response_callback()\n")));
++ return;
+ }
+ put_fail_exit:
+- /*
++ /*
+ * request failed after a put or append operation. We
+ * need to signal the failure to the GASS system
+ */
+@@ -3669,38 +3669,38 @@ globus_l_gass_transfer_http_response_callback(
+
+ if(proto->waiting_for_response)
+ {
+- globus_byte_t * buffer;
+- globus_size_t offset;
+- int failed = proto->failure_occurred;
+-
++ globus_byte_t * buffer;
++ globus_size_t offset;
++ int failed = proto->failure_occurred;
+
+- buffer = proto->user_buffer;
+- offset = proto->user_offset;
+
+- result = globus_l_gass_transfer_http_register_close(proto);
++ buffer = proto->user_buffer;
++ offset = proto->user_offset;
++
++ result = globus_l_gass_transfer_http_register_close(proto);
+
+ if (result != GLOBUS_SUCCESS)
+ {
+ globus_l_gass_transfer_http_close(proto);
+ }
+-
+- globus_l_gass_transfer_http_unlock();
+- debug_printf(2, (_GTSL("calling globus_gass_transfer_proto_send_complete()")));
+- globus_gass_transfer_proto_send_complete(request,
+- buffer,
+- offset,
+- failed,
+- GLOBUS_TRUE);
+- debug_printf(3, (_GTSL("Exiting globus_l_gass_transfer_http_response_callback()\n")));
+- return;
++
++ globus_l_gass_transfer_http_unlock();
++ debug_printf(2, (_GTSL("calling globus_gass_transfer_proto_send_complete()")));
++ globus_gass_transfer_proto_send_complete(request,
++ buffer,
++ offset,
++ failed,
++ GLOBUS_TRUE);
++ debug_printf(3, (_GTSL("Exiting globus_l_gass_transfer_http_response_callback()\n")));
++ return;
+
+ }
+ else
+ {
+- proto->failure_occurred = GLOBUS_TRUE;
+- globus_l_gass_transfer_http_unlock();
++ proto->failure_occurred = GLOBUS_TRUE;
++ globus_l_gass_transfer_http_unlock();
+ }
+- debug_printf(3, (_GTSL("Exiting globus_l_gass_transfer_http_response_callback()\n")));
++ debug_printf(3, (_GTSL("Exiting globus_l_gass_transfer_http_response_callback()\n")));
+ }
+ /* globus_l_gass_transfer_http_response_callback() */
+
+@@ -3708,17 +3708,17 @@ globus_l_gass_transfer_http_response_callback(
+ static
+ void
+ globus_l_gass_transfer_http_request_callback(
+- void * arg,
+- globus_io_handle_t * handle,
+- globus_result_t result,
+- globus_byte_t * buf,
+- globus_size_t nbytes)
++ void * arg,
++ globus_io_handle_t * handle,
++ globus_result_t result,
++ globus_byte_t * buf,
++ globus_size_t nbytes)
+ {
+- globus_gass_transfer_http_request_proto_t * proto;
+- globus_gass_transfer_http_listener_proto_t * l_proto;
+- globus_object_t * err=GLOBUS_NULL;
+- char * value;
+- globus_gass_transfer_request_t request;
++ globus_gass_transfer_http_request_proto_t * proto;
++ globus_gass_transfer_http_listener_proto_t * l_proto;
++ globus_object_t * err=GLOBUS_NULL;
++ char * value;
++ globus_gass_transfer_request_t request;
+ MYNAME(globus_l_gass_transfer_http_request_callback);
+
+ debug_printf(3, (_GTSL("Entering %s()\n"),myname));
+@@ -3729,21 +3729,21 @@ globus_l_gass_transfer_http_request_callback(
+ {
+ char * tmpstr;
+
+- err = globus_error_get(result);
+- tmpstr = globus_object_printable_to_string(err);
+- debug_printf(5, (_GTSL("globus_l_gass_transfer_http_read_callback(): %s"), tmpstr));
+- globus_libc_free(tmpstr);
++ err = globus_error_get(result);
++ tmpstr = globus_object_printable_to_string(err);
++ debug_printf(5, (_GTSL("globus_l_gass_transfer_http_read_callback(): %s"), tmpstr));
++ globus_libc_free(tmpstr);
+ }
+
+ globus_l_gass_transfer_http_lock();
+
+ request = proto->request;
+-
++
+ /* Did the read succeed? */
+ if(result != GLOBUS_SUCCESS &&
+ !globus_io_eof(err))
+ {
+- goto deny_exit;
++ goto deny_exit;
+ }
+
+ /* Update our counters */
+@@ -3752,74 +3752,74 @@ globus_l_gass_transfer_http_request_callback(
+ /* Parse the buffer that we have */
+ if(globus_l_gass_transfer_http_parse_request(proto))
+ {
+- /* returns true, if we need to read some more */
+- if(proto->parsed_offset == 0 &&
+- proto->response_offset > 0 &&
+- !isupper(proto->response_buffer[0]))
+- {
+- goto deny_exit;
+- }
+- goto repost_read;
++ /* returns true, if we need to read some more */
++ if(proto->parsed_offset == 0 &&
++ proto->response_offset > 0 &&
++ !isupper(proto->response_buffer[0]))
++ {
++ goto deny_exit;
++ }
++ goto repost_read;
+ }
+ else if(proto->parse_error)
+ {
+- goto deny_exit;
++ goto deny_exit;
+ }
+ else if(strcmp(proto->uri, "*") == 0)
+ {
+- /* Request we don't handle */
+- goto deny_exit;
++ /* Request we don't handle */
++ goto deny_exit;
+ }
+ else if(strcmp(proto->method, "GET") == 0)
+ {
+- proto->type = GLOBUS_GASS_TRANSFER_REQUEST_TYPE_GET;
++ proto->type = GLOBUS_GASS_TRANSFER_REQUEST_TYPE_GET;
+ }
+ else if(strcmp(proto->method, "PUT") == 0)
+ {
+- proto->type = GLOBUS_GASS_TRANSFER_REQUEST_TYPE_PUT;
++ proto->type = GLOBUS_GASS_TRANSFER_REQUEST_TYPE_PUT;
+ }
+ else if(strcmp(proto->method, "POST") == 0 &&
+- strncmp(proto->uri,
+- GLOBUS_L_APPEND_URI,
+- strlen(GLOBUS_L_APPEND_URI)) == 0)
++ strncmp(proto->uri,
++ GLOBUS_L_APPEND_URI,
++ strlen(GLOBUS_L_APPEND_URI)) == 0)
+ {
+- globus_size_t append_len;
+- globus_size_t uri_len;
++ globus_size_t append_len;
++ globus_size_t uri_len;
+
+- append_len = strlen(GLOBUS_L_APPEND_URI);
+- uri_len = strlen(proto->uri) - strlen(GLOBUS_L_APPEND_URI);
++ append_len = strlen(GLOBUS_L_APPEND_URI);
++ uri_len = strlen(proto->uri) - strlen(GLOBUS_L_APPEND_URI);
+
+- proto->type = GLOBUS_GASS_TRANSFER_REQUEST_TYPE_APPEND;
+- memmove(proto->uri,
+- proto->uri + append_len,
+- uri_len);
+- proto->uri[uri_len] = '\0';
++ proto->type = GLOBUS_GASS_TRANSFER_REQUEST_TYPE_APPEND;
++ memmove(proto->uri,
++ proto->uri + append_len,
++ uri_len);
++ proto->uri[uri_len] = '\0';
+
+ }
+ else
+ {
+- /* Unknown/Unsupported method */
+- goto deny_exit;
++ /* Unknown/Unsupported method */
++ goto deny_exit;
+ }
+ globus_gass_transfer_request_set_type(proto->request,
+- proto->type);
++ proto->type);
+ /* Construct URL for this request */
+ if(strncmp(proto->uri, "https://", strlen("https://")) == 0 ||
+ strncmp(proto->uri, "http://", strlen("http://")) == 0)
+ {
+- globus_gass_transfer_request_set_url(proto->request,
+- proto->uri);
++ globus_gass_transfer_request_set_url(proto->request,
++ proto->uri);
+ }
+ else
+ {
+- char * url_base;
+- char * url;
++ char * url_base;
++ char * url;
+
+- url_base = globus_gass_transfer_listener_get_base_url(l_proto->listener);
+- url = globus_malloc(strlen(url_base) + strlen(proto->uri) + 1);
+- sprintf(url, "%s%s", url_base, proto->uri);
+- globus_gass_transfer_request_set_url(proto->request,
+- url);
++ url_base = globus_gass_transfer_listener_get_base_url(l_proto->listener);
++ url = globus_malloc(strlen(url_base) + strlen(proto->uri) + 1);
++ sprintf(url, "%s%s", url_base, proto->uri);
++ globus_gass_transfer_request_set_url(proto->request,
++ url);
+ }
+
+ /*
+@@ -3827,94 +3827,94 @@ globus_l_gass_transfer_http_request_callback(
+ * care about
+ */
+ value = globus_i_gass_transfer_keyvalue_lookup(
+- &proto->headers,
+- "transfer-encoding");
++ &proto->headers,
++ "transfer-encoding");
+ if(value)
+ {
+- char * tmp;
++ char * tmp;
+
+- for(tmp = value; *tmp != '\0'; tmp++)
+- {
+- if(! isspace(*tmp))
+- {
+- break;
+- }
+- }
++ for(tmp = value; *tmp != '\0'; tmp++)
++ {
++ if(! isspace(*tmp))
++ {
++ break;
++ }
++ }
+ #ifndef TARGET_ARCH_WIN32
+- if(strncasecmp(tmp, "chunked", strlen("chunked")) == 0)
++ if(strncasecmp(tmp, "chunked", strlen("chunked")) == 0)
+ #else
+- if(strnicmp(tmp, "chunked", strlen("chunked")) == 0)
++ if(strnicmp(tmp, "chunked", strlen("chunked")) == 0)
+ #endif
+- {
+- proto->recv_buffer =
+- globus_l_gass_transfer_http_receive;
+- proto->chunked = GLOBUS_TRUE;
+- proto->recv_state =
+- GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_CHUNK_SIZE;
+- proto->length = 0;
+- }
++ {
++ proto->recv_buffer =
++ globus_l_gass_transfer_http_receive;
++ proto->chunked = GLOBUS_TRUE;
++ proto->recv_state =
++ GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_CHUNK_SIZE;
++ proto->length = 0;
++ }
+ }
+ if(!proto->chunked)
+ {
+- /* If both
+- * Transfer-Encoding: chunked and
+- * Content-Length: <something>
+- * are passed, the Content-length should be ignored,
+- * according to RFC 2068
+- */
+- value = globus_i_gass_transfer_keyvalue_lookup(
+- &proto->headers,
+- "content-length");
+-
+- if(value)
+- {
+- int save_errno;
+- char * tmp;
+-
+- for(tmp = value; *tmp != '\0'; tmp++)
+- {
+- if(! isspace(*tmp))
+- {
+- break;
+- }
+- }
+- globus_libc_lock();
+- errno=0;
+- proto->length = strtoul(tmp,
+- GLOBUS_NULL,
+- 10);
+- save_errno=errno;
+- globus_libc_unlock();
+- if(save_errno != 0)
+- {
+- proto->code = GLOBUS_L_PROTOCOL_FAILURE_CODE;
+- proto->reason = globus_libc_strdup(
+- GLOBUS_L_PROTOCOL_FAILURE_REASON);
+- goto deny_exit;
+- }
+- if(proto->length == 0)
+- {
+- proto->recv_state =
+- GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_ERROR;
+- }
+- else
+- {
+- proto->recv_state =
+- GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_UNTIL_LENGTH;
+- }
+- }
+- else
+- {
+- proto->recv_state =
+- GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_UNTIL_EOF;
+- }
+-
+- if(!proto->text_mode)
+- {
+- globus_gass_transfer_request_set_length(proto->request,
+- proto->length);
+-
+- }
++ /* If both
++ * Transfer-Encoding: chunked and
++ * Content-Length: <something>
++ * are passed, the Content-length should be ignored,
++ * according to RFC 2068
++ */
++ value = globus_i_gass_transfer_keyvalue_lookup(
++ &proto->headers,
++ "content-length");
++
++ if(value)
++ {
++ int save_errno;
++ char * tmp;
++
++ for(tmp = value; *tmp != '\0'; tmp++)
++ {
++ if(! isspace(*tmp))
++ {
++ break;
++ }
++ }
++ globus_libc_lock();
++ errno=0;
++ proto->length = strtoul(tmp,
++ GLOBUS_NULL,
++ 10);
++ save_errno=errno;
++ globus_libc_unlock();
++ if(save_errno != 0)
++ {
++ proto->code = GLOBUS_L_PROTOCOL_FAILURE_CODE;
++ proto->reason = globus_libc_strdup(
++ GLOBUS_L_PROTOCOL_FAILURE_REASON);
++ goto deny_exit;
++ }
++ if(proto->length == 0)
++ {
++ proto->recv_state =
++ GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_ERROR;
++ }
++ else
++ {
++ proto->recv_state =
++ GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_UNTIL_LENGTH;
++ }
++ }
++ else
++ {
++ proto->recv_state =
++ GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_UNTIL_EOF;
++ }
++
++ if(!proto->text_mode)
++ {
++ globus_gass_transfer_request_set_length(proto->request,
++ proto->length);
++
++ }
+ }
+ /*
+ * The response buffer's residue may contain some
+@@ -3922,20 +3922,20 @@ globus_l_gass_transfer_http_request_callback(
+ * Also, if we are in text mode, we'll have to copy
+ * the data anyway (but should use the block_size)
+ */
+-
++
+ if(proto->text_mode &&
+ proto->block_size > proto->response_buflen)
+ {
+- globus_byte_t * tmp;
++ globus_byte_t * tmp;
+
+- tmp = globus_libc_realloc(proto->response_buffer,
+- proto->block_size *
+- sizeof(globus_byte_t));
+- if(tmp != GLOBUS_NULL)
+- {
+- proto->response_buffer = tmp;
+- proto->response_buflen = proto->block_size;
+- }
++ tmp = globus_libc_realloc(proto->response_buffer,
++ proto->block_size *
++ sizeof(globus_byte_t));
++ if(tmp != GLOBUS_NULL)
++ {
++ proto->response_buffer = tmp;
++ proto->response_buflen = proto->block_size;
++ }
+
+ }
+
+@@ -3944,16 +3944,16 @@ globus_l_gass_transfer_http_request_callback(
+ proto->state = GLOBUS_GASS_TRANSFER_HTTP_STATE_IDLE;
+ if(proto->connected_subject)
+ {
+- globus_gass_transfer_request_set_subject(proto->request,
+- globus_libc_strdup(proto->connected_subject));
++ globus_gass_transfer_request_set_subject(proto->request,
++ globus_libc_strdup(proto->connected_subject));
+ }
+
+ globus_l_gass_transfer_http_unlock();
+
+ globus_gass_transfer_proto_new_listener_request(
+- l_proto->listener,
+- proto->request,
+- (globus_gass_transfer_request_proto_t *) proto);
++ l_proto->listener,
++ proto->request,
++ (globus_gass_transfer_request_proto_t *) proto);
+
+
+ debug_printf(3, (_GTSL("Exiting globus_l_gass_transfer_http_request_callback()\n")));
+@@ -3962,47 +3962,47 @@ globus_l_gass_transfer_http_request_callback(
+ repost_read:
+ if(result != GLOBUS_SUCCESS)
+ {
+- goto deny_exit;
++ goto deny_exit;
+ }
+
+ /* Reallocate a larger buffer, if we need to */
+ if(proto->response_buflen == proto->response_offset)
+ {
+- globus_byte_t * tmp;
+- tmp = globus_libc_realloc(proto->response_buffer,
+- proto->response_buflen *
+- 2 *
+- sizeof(globus_byte_t));
+- if(tmp == GLOBUS_NULL)
+- {
+- proto->code = GLOBUS_L_MALLOC_FAILURE_CODE;
+- proto->reason = globus_libc_strdup(GLOBUS_L_MALLOC_FAILURE_REASON);
+-
+- goto deny_exit;
+- }
+- else
+- {
+- proto->response_buffer = tmp;
+- proto->response_buflen *= 2;
+- }
++ globus_byte_t * tmp;
++ tmp = globus_libc_realloc(proto->response_buffer,
++ proto->response_buflen *
++ 2 *
++ sizeof(globus_byte_t));
++ if(tmp == GLOBUS_NULL)
++ {
++ proto->code = GLOBUS_L_MALLOC_FAILURE_CODE;
++ proto->reason = globus_libc_strdup(GLOBUS_L_MALLOC_FAILURE_REASON);
++
++ goto deny_exit;
++ }
++ else
++ {
++ proto->response_buffer = tmp;
++ proto->response_buflen *= 2;
++ }
+ }
+
+ /* Register another read */
+ debug_printf(4,(_GTSL("%s(): Registering read on %p\n"),
+- myname,
+- &proto->handle));
++ myname,
++ &proto->handle));
+ result = globus_io_register_read(&proto->handle,
+- proto->response_buffer +
+- proto->response_offset,
+- proto->response_buflen -
+- proto->response_offset,
+- 1,
+- globus_l_gass_transfer_http_request_callback,
+- l_proto);
++ proto->response_buffer +
++ proto->response_offset,
++ proto->response_buflen -
++ proto->response_offset,
++ 1,
++ globus_l_gass_transfer_http_request_callback,
++ l_proto);
+ if(result != GLOBUS_SUCCESS)
+ {
+- /* TODO interpret the error object */
+- goto deny_exit;
++ /* TODO interpret the error object */
++ goto deny_exit;
+ }
+ globus_l_gass_transfer_http_unlock();
+
+@@ -4012,7 +4012,7 @@ globus_l_gass_transfer_http_request_callback(
+ deny_exit:
+ if(err)
+ {
+- globus_object_free(err);
++ globus_object_free(err);
+ }
+
+ /*
+@@ -4033,13 +4033,13 @@ globus_l_gass_transfer_http_request_callback(
+ {
+ globus_l_gass_transfer_http_close(proto);
+ }
+-
++
+ globus_l_gass_transfer_http_unlock();
+
+ globus_gass_transfer_proto_new_listener_request(
+- l_proto->listener,
+- request,
+- (globus_gass_transfer_request_proto_t *) GLOBUS_NULL);
++ l_proto->listener,
++ request,
++ (globus_gass_transfer_request_proto_t *) GLOBUS_NULL);
+
+ debug_printf(3, (_GTSL("Exiting globus_l_gass_transfer_http_request_callback()\n")));
+ return;
+@@ -4049,21 +4049,21 @@ globus_l_gass_transfer_http_request_callback(
+ static
+ void
+ globus_l_gass_transfer_http_callback_send_callback(
+- void * arg)
++ void * arg)
+ {
+- globus_gass_transfer_http_request_proto_t * proto;
++ globus_gass_transfer_http_request_proto_t * proto;
+ MYNAME(globus_l_gass_transfer_http_callback_send_callback);
+
+ debug_printf(3, (_GTSL("Entering %s()\n"),myname));
+-
++
+ proto = (globus_gass_transfer_http_request_proto_t *) arg;
+
+ debug_printf(2, (_GTSL("calling globus_gass_transfer_proto_send_complete()")));
+ globus_gass_transfer_proto_send_complete(proto->request,
+- proto->user_buffer,
+- proto->user_offset,
+- proto->failure_occurred,
+- proto->failure_occurred);
++ proto->user_buffer,
++ proto->user_offset,
++ proto->failure_occurred,
++ proto->failure_occurred);
+ debug_printf(3, (_GTSL("Exiting globus_l_gass_transfer_http_callback_send_callback()\n")));
+ }
+
+@@ -4071,23 +4071,23 @@ globus_l_gass_transfer_http_callback_send_callback(
+ static
+ void
+ globus_l_gass_transfer_http_callback_ready_callback(
+- void * arg)
++ void * arg)
+ {
+- globus_gass_transfer_http_request_proto_t * proto;
++ globus_gass_transfer_http_request_proto_t * proto;
+
+ proto = (globus_gass_transfer_http_request_proto_t *) arg;
+
+ debug_printf(2, (_GTSL("calling globus_gass_transfer_proto_request_ready")));
+ globus_gass_transfer_proto_request_ready(proto->request,
+- (globus_gass_transfer_request_proto_t *) proto);
++ (globus_gass_transfer_request_proto_t *) proto);
+ }
+ /* globus_l_gass_transfer_http_callback_read_buffered_callback() */
+ static
+ void
+ globus_l_gass_transfer_http_callback_read_buffered_callback(
+- void * arg)
++ void * arg)
+ {
+- globus_gass_transfer_http_request_proto_t * proto;
++ globus_gass_transfer_http_request_proto_t * proto;
+
+ proto = (globus_gass_transfer_http_request_proto_t *) arg;
+
+@@ -4099,11 +4099,11 @@ globus_l_gass_transfer_http_callback_read_buffered_callback(
+ globus_l_gass_transfer_http_unlock();
+
+ globus_l_gass_transfer_http_read_buffered_callback(arg,
+- &proto->handle,
+- GLOBUS_SUCCESS,
+- proto->response_buffer +
+- proto->response_offset,
+- 0);
++ &proto->handle,
++ GLOBUS_SUCCESS,
++ proto->response_buffer +
++ proto->response_offset,
++ 0);
+ }
+ /* globus_l_gass_transfer_http_callback_read_buffered_callback() */
+
+@@ -4111,10 +4111,10 @@ globus_l_gass_transfer_http_callback_read_buffered_callback(
+ static
+ void
+ globus_l_gass_transfer_http_callback_listen_callback(
+- void * arg)
++ void * arg)
+ {
+ globus_gass_transfer_http_listener_proto_t *proto;
+- globus_gass_transfer_listener_t listener;
++ globus_gass_transfer_listener_t listener;
+
+ proto = (globus_gass_transfer_http_listener_proto_t *) arg;
+
+@@ -4122,7 +4122,7 @@ globus_l_gass_transfer_http_callback_listen_callback(
+
+ if(proto->state == GLOBUS_GASS_TRANSFER_HTTP_LISTENER_LISTENING)
+ {
+- proto->state = GLOBUS_GASS_TRANSFER_HTTP_LISTENER_READY;
++ proto->state = GLOBUS_GASS_TRANSFER_HTTP_LISTENER_READY;
+ }
+
+ listener = proto->listener;
+@@ -4136,21 +4136,21 @@ globus_l_gass_transfer_http_callback_listen_callback(
+ static
+ void
+ globus_l_gass_transfer_http_accept(
+- globus_gass_transfer_listener_proto_t * proto,
+- globus_gass_transfer_listener_t listener,
+- globus_gass_transfer_request_t request,
+- globus_gass_transfer_requestattr_t * attr)
++ globus_gass_transfer_listener_proto_t * proto,
++ globus_gass_transfer_listener_t listener,
++ globus_gass_transfer_request_t request,
++ globus_gass_transfer_requestattr_t * attr)
+ {
+- globus_result_t result;
+- globus_io_attr_t tcp_attr;
++ globus_result_t result;
++ globus_io_attr_t tcp_attr;
+ globus_gass_transfer_http_listener_proto_t *
+- l_proto;
+- int rc;
+- int sndbuf;
+- int rcvbuf;
+- globus_bool_t nodelay;
+- globus_gass_transfer_file_mode_t file_mode=GLOBUS_GASS_TRANSFER_FILE_MODE_BINARY;
+- globus_io_secure_authorization_data_t data;
++ l_proto;
++ int rc;
++ int sndbuf;
++ int rcvbuf;
++ globus_bool_t nodelay;
++ globus_gass_transfer_file_mode_t file_mode=GLOBUS_GASS_TRANSFER_FILE_MODE_BINARY;
++ globus_io_secure_authorization_data_t data;
+ globus_l_gass_transfer_failed_kickout_closure_t *kickout;
+ globus_reltime_t delay_time;
+ MYNAME(globus_l_gass_transfer_http_accept);
+@@ -4159,193 +4159,193 @@ globus_l_gass_transfer_http_accept(
+ l_proto = (globus_gass_transfer_http_listener_proto_t *) proto;
+
+ /* Allocate proto instance */
+- l_proto->request = (globus_gass_transfer_http_request_proto_t *)
+- globus_malloc(sizeof(globus_gass_transfer_http_request_proto_t));
++ l_proto->request = (globus_gass_transfer_http_request_proto_t *)
++ globus_malloc(sizeof(globus_gass_transfer_http_request_proto_t));
+
+ if(l_proto->request == GLOBUS_NULL)
+ {
+- goto error_exit;
++ goto error_exit;
+ }
+
+ result = globus_io_tcpattr_init(&tcp_attr);
+ if(result != GLOBUS_SUCCESS)
+ {
+- goto proto_error;
++ goto proto_error;
+ }
+ globus_io_attr_set_socket_keepalive(&tcp_attr, GLOBUS_TRUE);
+
+ if(attr != GLOBUS_NULL &&
+ *attr != GLOBUS_NULL)
+ {
+- /* Check attributes we care about */
+- rc = globus_gass_transfer_requestattr_get_socket_sndbuf(
+- attr,
+- &sndbuf);
+- if(rc != GLOBUS_SUCCESS)
+- {
+- goto tcpattr_error;
+- }
+- else
+- {
+- if(sndbuf != 0)
+- {
+- globus_io_attr_set_socket_sndbuf(&tcp_attr,
+- sndbuf);
+- }
+- }
+-
+- rc = globus_gass_transfer_requestattr_get_socket_rcvbuf(
+- attr,
+- &rcvbuf);
+- if(rc != GLOBUS_SUCCESS)
+- {
+- goto tcpattr_error;
+- }
+- else
+- {
+- if(rcvbuf != 0)
+- {
+- globus_io_attr_set_socket_rcvbuf(&tcp_attr,
+- rcvbuf);
+- }
+- }
+-
+- rc = globus_gass_transfer_requestattr_get_socket_nodelay(
+- attr,
+- &nodelay);
+- if(rc != GLOBUS_SUCCESS)
+- {
+- goto tcpattr_error;
+- }
+- else
+- {
+- globus_io_attr_set_tcp_nodelay(&tcp_attr,
+- nodelay);
+- }
+-
+- /* File mode is important on Windows */
+- rc = globus_gass_transfer_requestattr_get_file_mode(attr,
+- &file_mode);
+- if(rc != GLOBUS_SUCCESS)
+- {
+- goto tcpattr_error;
+- }
+- rc = globus_gass_transfer_requestattr_get_block_size(
+- attr,
+- &l_proto->request->block_size);
+- if(rc != GLOBUS_SUCCESS)
+- {
+- goto tcpattr_error;
+- }
++ /* Check attributes we care about */
++ rc = globus_gass_transfer_requestattr_get_socket_sndbuf(
++ attr,
++ &sndbuf);
++ if(rc != GLOBUS_SUCCESS)
++ {
++ goto tcpattr_error;
++ }
++ else
++ {
++ if(sndbuf != 0)
++ {
++ globus_io_attr_set_socket_sndbuf(&tcp_attr,
++ sndbuf);
++ }
++ }
++
++ rc = globus_gass_transfer_requestattr_get_socket_rcvbuf(
++ attr,
++ &rcvbuf);
++ if(rc != GLOBUS_SUCCESS)
++ {
++ goto tcpattr_error;
++ }
++ else
++ {
++ if(rcvbuf != 0)
++ {
++ globus_io_attr_set_socket_rcvbuf(&tcp_attr,
++ rcvbuf);
++ }
++ }
++
++ rc = globus_gass_transfer_requestattr_get_socket_nodelay(
++ attr,
++ &nodelay);
++ if(rc != GLOBUS_SUCCESS)
++ {
++ goto tcpattr_error;
++ }
++ else
++ {
++ globus_io_attr_set_tcp_nodelay(&tcp_attr,
++ nodelay);
++ }
++
++ /* File mode is important on Windows */
++ rc = globus_gass_transfer_requestattr_get_file_mode(attr,
++ &file_mode);
++ if(rc != GLOBUS_SUCCESS)
++ {
++ goto tcpattr_error;
++ }
++ rc = globus_gass_transfer_requestattr_get_block_size(
++ attr,
++ &l_proto->request->block_size);
++ if(rc != GLOBUS_SUCCESS)
++ {
++ goto tcpattr_error;
++ }
+ }
+
+ /* If https, set security attributes for the request */
+ if(l_proto->url_scheme == GLOBUS_URL_SCHEME_HTTPS)
+ {
+- globus_result_t result;
+-
+-
+- globus_io_secure_authorization_data_initialize(&data);
+-
+- result = globus_io_attr_set_secure_authentication_mode(
+- &tcp_attr,
+- GLOBUS_IO_SECURE_AUTHENTICATION_MODE_MUTUAL,
+- GLOBUS_NULL);
+-
+- if(result != GLOBUS_SUCCESS)
+- {
+- goto free_auth_data;
+- }
+- result = globus_io_attr_set_secure_channel_mode(
+- &tcp_attr,
+- GLOBUS_IO_SECURE_CHANNEL_MODE_SSL_WRAP);
+-
+- if(result != GLOBUS_SUCCESS)
+- {
+- goto free_auth_data;
+- }
+- if(attr != GLOBUS_NULL)
+- {
+- if(*attr != GLOBUS_NULL)
+- {
+- rc = globus_gass_transfer_secure_requestattr_get_authorization(
+- attr,
+- &l_proto->request->authorization_mode,
+- &l_proto->request->authorized_subject);
+-
+- if(rc != GLOBUS_SUCCESS)
+- {
+- goto free_auth_data;
+- }
+- }
+- }
+- result = globus_io_secure_authorization_data_set_callback(
+- &data,
+- globus_l_gass_transfer_http_authorization_callback,
+- proto);
+-
+- if(result != GLOBUS_SUCCESS)
+- {
+- goto free_auth_data;
+- }
+-
+- result = globus_io_attr_set_secure_authorization_mode(
+- &tcp_attr,
+- GLOBUS_IO_SECURE_AUTHORIZATION_MODE_CALLBACK,
+- &data);
+-
+- if(result != GLOBUS_SUCCESS)
+- {
+- goto free_auth_data;
+- }
+- globus_io_secure_authorization_data_destroy(&data);
++ globus_result_t result;
++
++
++ globus_io_secure_authorization_data_initialize(&data);
++
++ result = globus_io_attr_set_secure_authentication_mode(
++ &tcp_attr,
++ GLOBUS_IO_SECURE_AUTHENTICATION_MODE_MUTUAL,
++ GLOBUS_NULL);
++
++ if(result != GLOBUS_SUCCESS)
++ {
++ goto free_auth_data;
++ }
++ result = globus_io_attr_set_secure_channel_mode(
++ &tcp_attr,
++ GLOBUS_IO_SECURE_CHANNEL_MODE_SSL_WRAP);
++
++ if(result != GLOBUS_SUCCESS)
++ {
++ goto free_auth_data;
++ }
++ if(attr != GLOBUS_NULL)
++ {
++ if(*attr != GLOBUS_NULL)
++ {
++ rc = globus_gass_transfer_secure_requestattr_get_authorization(
++ attr,
++ &l_proto->request->authorization_mode,
++ &l_proto->request->authorized_subject);
++
++ if(rc != GLOBUS_SUCCESS)
++ {
++ goto free_auth_data;
++ }
++ }
++ }
++ result = globus_io_secure_authorization_data_set_callback(
++ &data,
++ globus_l_gass_transfer_http_authorization_callback,
++ proto);
++
++ if(result != GLOBUS_SUCCESS)
++ {
++ goto free_auth_data;
++ }
++
++ result = globus_io_attr_set_secure_authorization_mode(
++ &tcp_attr,
++ GLOBUS_IO_SECURE_AUTHORIZATION_MODE_CALLBACK,
++ &data);
++
++ if(result != GLOBUS_SUCCESS)
++ {
++ goto free_auth_data;
++ }
++ globus_io_secure_authorization_data_destroy(&data);
+ }
+
+ /* Initialize the proto instance */
+ l_proto->request->send_buffer= globus_l_gass_transfer_http_send;
+- l_proto->request->recv_buffer = globus_l_gass_transfer_http_receive;
+- l_proto->request->fail = globus_l_gass_transfer_http_fail;
+- l_proto->request->deny = globus_l_gass_transfer_http_request_deny;
+- l_proto->request->refer = globus_l_gass_transfer_http_request_refer;
+- l_proto->request->authorize = globus_l_gass_transfer_http_request_authorize;
+- l_proto->request->destroy = globus_l_gass_transfer_http_destroy;
+- l_proto->request->text_mode = (file_mode == GLOBUS_GASS_TRANSFER_FILE_MODE_TEXT);
+- l_proto->request->line_mode = GLOBUS_L_LINE_MODE_UNKNOWN;
+- l_proto->request->state = GLOBUS_GASS_TRANSFER_HTTP_STATE_CONNECTING;
+- l_proto->request->request = request;
+- l_proto->request->type = globus_gass_transfer_request_get_type(request);
+- l_proto->request->code = 0;
+- l_proto->request->reason = 0;
+- l_proto->request->parse_error = GLOBUS_FALSE;
+- l_proto->request->destroy_called = GLOBUS_FALSE;
+- l_proto->request->headers = GLOBUS_NULL;
+- l_proto->request->response_buffer = GLOBUS_NULL;
+- l_proto->request->length = 0;
+- l_proto->request->handled = 0;
+- l_proto->request->chunked = GLOBUS_FALSE;
+- l_proto->request->chunk_left = 0;
+- l_proto->request->failure_occurred = GLOBUS_FALSE;
++ l_proto->request->recv_buffer = globus_l_gass_transfer_http_receive;
++ l_proto->request->fail = globus_l_gass_transfer_http_fail;
++ l_proto->request->deny = globus_l_gass_transfer_http_request_deny;
++ l_proto->request->refer = globus_l_gass_transfer_http_request_refer;
++ l_proto->request->authorize = globus_l_gass_transfer_http_request_authorize;
++ l_proto->request->destroy = globus_l_gass_transfer_http_destroy;
++ l_proto->request->text_mode = (file_mode == GLOBUS_GASS_TRANSFER_FILE_MODE_TEXT);
++ l_proto->request->line_mode = GLOBUS_L_LINE_MODE_UNKNOWN;
++ l_proto->request->state = GLOBUS_GASS_TRANSFER_HTTP_STATE_CONNECTING;
++ l_proto->request->request = request;
++ l_proto->request->type = globus_gass_transfer_request_get_type(request);
++ l_proto->request->code = 0;
++ l_proto->request->reason = 0;
++ l_proto->request->parse_error = GLOBUS_FALSE;
++ l_proto->request->destroy_called = GLOBUS_FALSE;
++ l_proto->request->headers = GLOBUS_NULL;
++ l_proto->request->response_buffer = GLOBUS_NULL;
++ l_proto->request->length = 0;
++ l_proto->request->handled = 0;
++ l_proto->request->chunked = GLOBUS_FALSE;
++ l_proto->request->chunk_left = 0;
++ l_proto->request->failure_occurred = GLOBUS_FALSE;
+ l_proto->request->oneshot_registered = GLOBUS_FALSE;
+- l_proto->request->oneshot_active = GLOBUS_FALSE;
+- l_proto->request->eof_read = GLOBUS_FALSE;
+- l_proto->request->method = GLOBUS_NULL;
+- l_proto->request->uri = GLOBUS_NULL;
+- l_proto->request->response_offset = 0;
+- l_proto->request->parsed_offset = 0;
+- l_proto->request->client_side = GLOBUS_FALSE;
+- l_proto->request->connected_subject = GLOBUS_NULL;
++ l_proto->request->oneshot_active = GLOBUS_FALSE;
++ l_proto->request->eof_read = GLOBUS_FALSE;
++ l_proto->request->method = GLOBUS_NULL;
++ l_proto->request->uri = GLOBUS_NULL;
++ l_proto->request->response_offset = 0;
++ l_proto->request->parsed_offset = 0;
++ l_proto->request->client_side = GLOBUS_FALSE;
++ l_proto->request->connected_subject = GLOBUS_NULL;
+
+ /* Register accept with new request */
+ l_proto->state = GLOBUS_GASS_TRANSFER_HTTP_LISTENER_ACCEPTING;
+
+ debug_printf(4,(_GTSL("%s(): Registering accept on %p\n"),
+- myname,
+- &l_proto->handle));
++ myname,
++ &l_proto->handle));
+ result = globus_io_tcp_register_accept(&l_proto->handle,
+- &tcp_attr,
+- &l_proto->request->handle,
+- globus_l_gass_transfer_http_accept_callback,
+- l_proto);
++ &tcp_attr,
++ &l_proto->request->handle,
++ globus_l_gass_transfer_http_accept_callback,
++ l_proto);
+ if(result != GLOBUS_SUCCESS)
+ {
+ goto tcpattr_error;
+@@ -4370,7 +4370,7 @@ globus_l_gass_transfer_http_accept(
+
+ GlobusTimeReltimeSet(delay_time, 0, 0);
+ debug_printf(4,(_GTSL("%s(): Registering oneshot\n"),
+- myname));
++ myname));
+ kickout = globus_libc_malloc(
+ sizeof(globus_l_gass_transfer_failed_kickout_closure_t));
+
+@@ -4379,9 +4379,9 @@ globus_l_gass_transfer_http_accept(
+
+ globus_callback_register_oneshot(
+ GLOBUS_NULL,
+- &delay_time,
+- globus_l_gass_transfer_http_accept_failed_kickout,
+- kickout);
++ &delay_time,
++ globus_l_gass_transfer_http_accept_failed_kickout,
++ kickout);
+
+ debug_printf(1, (_GTSL("exiting %s()\n"),myname));
+ }
+@@ -4390,10 +4390,10 @@ globus_l_gass_transfer_http_accept(
+ static
+ globus_result_t
+ globus_l_gass_transfer_http_register_read(
+- globus_gass_transfer_http_request_proto_t * proto)
++ globus_gass_transfer_http_request_proto_t * proto)
+ {
+ MYNAME(globus_l_gass_transfer_http_register_read);
+-
++
+ /*
+ * If binary, and some chunk data is unread from the handle,
+ * or we are not chunked, we can read directly into the user's
+@@ -4401,77 +4401,77 @@ globus_l_gass_transfer_http_register_read(
+ * to the user's buffer.
+ */
+ if(proto->text_mode == GLOBUS_FALSE &&
+- (
+- (proto->chunked &&
+- proto->chunk_left > 0 &&
+- proto->recv_state == GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_CHUNK_BODY) ||
+- (proto->chunked == GLOBUS_FALSE)
+- )
++ (
++ (proto->chunked &&
++ proto->chunk_left > 0 &&
++ proto->recv_state == GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_CHUNK_BODY) ||
++ (proto->chunked == GLOBUS_FALSE)
++ )
+ )
+
+ {
+- globus_size_t minimum;
+- globus_size_t maximum;
+-
+- minimum = proto->user_waitlen;
+-
+- if(minimum > proto->user_buflen - proto->user_offset)
+- {
+- minimum = proto->user_buflen - proto->user_offset;
+- }
+- if(proto->chunked && minimum > proto->chunk_left)
+- {
+- minimum = proto->chunk_left;
+- }
+- if(proto->length != 0 &&
+- minimum > proto->length - proto->handled)
+- {
+- minimum = proto->length - proto->handled;
+- }
+-
+- maximum = proto->user_buflen - proto->user_offset;
+-
+- if(proto->chunked && maximum > proto->chunk_left)
+- {
+- maximum = proto->chunk_left;
+- }
+- if(proto->length != 0 &&
+- maximum > proto->length - proto->handled)
+- {
+- maximum = proto->length - proto->handled;
+- }
+-
+- debug_printf(4,(_GTSL("%s(): Registering read on %p\n"),
+- myname,
+- &proto->handle));
+- return
+- globus_io_register_read(&proto->handle,
+- proto->user_buffer +
+- proto->user_offset,
+- maximum,
+- minimum,
+- globus_l_gass_transfer_http_read_callback,
+- proto);
+- }
++ globus_size_t minimum;
++ globus_size_t maximum;
++
++ minimum = proto->user_waitlen;
++
++ if(minimum > proto->user_buflen - proto->user_offset)
++ {
++ minimum = proto->user_buflen - proto->user_offset;
++ }
++ if(proto->chunked && minimum > proto->chunk_left)
++ {
++ minimum = proto->chunk_left;
++ }
++ if(proto->length != 0 &&
++ minimum > proto->length - proto->handled)
++ {
++ minimum = proto->length - proto->handled;
++ }
++
++ maximum = proto->user_buflen - proto->user_offset;
++
++ if(proto->chunked && maximum > proto->chunk_left)
++ {
++ maximum = proto->chunk_left;
++ }
++ if(proto->length != 0 &&
++ maximum > proto->length - proto->handled)
++ {
++ maximum = proto->length - proto->handled;
++ }
++
++ debug_printf(4,(_GTSL("%s(): Registering read on %p\n"),
++ myname,
++ &proto->handle));
++ return
++ globus_io_register_read(&proto->handle,
++ proto->user_buffer +
++ proto->user_offset,
++ maximum,
++ minimum,
++ globus_l_gass_transfer_http_read_callback,
++ proto);
++ }
+ else
+ {
+- /*
+- * In text mode or in "chunked" mode, we will have
+- * to buffer the data and then apply some transformation
+- * to it upon receiving it.
+- */
+- globus_size_t smaller;
++ /*
++ * In text mode or in "chunked" mode, we will have
++ * to buffer the data and then apply some transformation
++ * to it upon receiving it.
++ */
++ globus_size_t smaller;
+
+- smaller = proto->user_waitlen;
++ smaller = proto->user_waitlen;
+
+ if (proto->response_buflen - proto->response_offset == 0)
+ {
+ /* if buffer is full, shift unparsed data to buffer head */
+- memmove(proto->response_buffer,
+- proto->response_buffer + proto->parsed_offset,
+- proto->response_offset - proto->parsed_offset);
+- proto->response_offset -= proto->parsed_offset;
+- proto->parsed_offset = 0;
++ memmove(proto->response_buffer,
++ proto->response_buffer + proto->parsed_offset,
++ proto->response_offset - proto->parsed_offset);
++ proto->response_offset -= proto->parsed_offset;
++ proto->parsed_offset = 0;
+ }
+ if (proto->response_buflen - proto->response_offset == 0)
+ {
+@@ -4491,23 +4491,23 @@ globus_l_gass_transfer_http_register_read(
+ proto->response_buflen *= 2;
+ }
+ }
+- if(smaller > proto->response_buflen - proto->response_offset)
+- {
+- smaller = proto->response_buflen - proto->response_offset;
+- }
+-
+- debug_printf(4,(_GTSL("%s(): Registering read on %p\n"),
+- myname,
+- &proto->handle));
+- return
+- globus_io_register_read(&proto->handle,
+- proto->response_buffer +
+- proto->response_offset,
+- proto->response_buflen -
+- proto->response_offset,
+- smaller,
+- globus_l_gass_transfer_http_read_buffered_callback,
+- proto);
++ if(smaller > proto->response_buflen - proto->response_offset)
++ {
++ smaller = proto->response_buflen - proto->response_offset;
++ }
++
++ debug_printf(4,(_GTSL("%s(): Registering read on %p\n"),
++ myname,
++ &proto->handle));
++ return
++ globus_io_register_read(&proto->handle,
++ proto->response_buffer +
++ proto->response_offset,
++ proto->response_buflen -
++ proto->response_offset,
++ smaller,
++ globus_l_gass_transfer_http_read_buffered_callback,
++ proto);
+ }
+ }
+
+@@ -4554,15 +4554,15 @@ globus_l_gass_transfer_http_hex_escape(
+ static
+ char *
+ globus_l_gass_transfer_http_construct_request(
+- globus_gass_transfer_http_request_proto_t * proto)
++ globus_gass_transfer_http_request_proto_t * proto)
+ {
+- globus_size_t cmd_len;
+- char * cmd = GLOBUS_NULL;
+- globus_size_t length;
+- char * url = GLOBUS_NULL;
++ globus_size_t cmd_len;
++ char * cmd = GLOBUS_NULL;
++ globus_size_t length;
++ char * url = GLOBUS_NULL;
+
+ /* Construct the request string to send to the server */
+- cmd_len = 3; /* for CRLF\0 termination */
++ cmd_len = 3; /* for CRLF\0 termination */
+ cmd_len += strlen(proto->url.host); /* Required for http/1.1*/
+ if(proto->proxy_connect)
+ {
+@@ -4573,7 +4573,7 @@ globus_l_gass_transfer_http_construct_request(
+ return NULL;
+ }
+
+- cmd_len += strlen(url);
++ cmd_len += strlen(url);
+ }
+ else
+ {
+@@ -4583,242 +4583,242 @@ globus_l_gass_transfer_http_construct_request(
+ {
+ return NULL;
+ }
+- cmd_len += strlen(url);
++ cmd_len += strlen(url);
+ }
+
+ switch(proto->type)
+ {
+ case GLOBUS_GASS_TRANSFER_REQUEST_TYPE_GET:
+- cmd_len += strlen(GLOBUS_L_GET_COMMAND);
+- cmd = globus_malloc(cmd_len * sizeof(globus_byte_t));
++ cmd_len += strlen(GLOBUS_L_GET_COMMAND);
++ cmd = globus_malloc(cmd_len * sizeof(globus_byte_t));
+
+- if(cmd == GLOBUS_NULL)
+- {
++ if(cmd == GLOBUS_NULL)
++ {
+ globus_libc_free(url);
+
+- return GLOBUS_NULL;
+- }
+-
+- sprintf(cmd,
+- GLOBUS_L_GET_COMMAND,
+- url,
+- proto->url.host);
+-
+- strcat(cmd,
+- CRLF);
+-
++ return GLOBUS_NULL;
++ }
++
++ sprintf(cmd,
++ GLOBUS_L_GET_COMMAND,
++ url,
++ proto->url.host);
++
++ strcat(cmd,
++ CRLF);
++
+ globus_libc_free(url);
+- return cmd;
++ return cmd;
+
+ case GLOBUS_GASS_TRANSFER_REQUEST_TYPE_PUT:
+- cmd_len += strlen(GLOBUS_L_PUT_COMMAND);
+- cmd_len += 2;
+-
+- if(proto->text_mode == GLOBUS_TRUE)
+- {
+- cmd_len += strlen(GLOBUS_L_TEXT_HEADER);
+- }
+- else
+- {
+- cmd_len += strlen(GLOBUS_L_BINARY_HEADER);
+- }
+-
+- length = globus_gass_transfer_request_get_length(proto->request);
+- if(length != 0)
+- {
+- globus_size_t x = length;
+- globus_size_t digits = 0;
+-
+- /* count the number of decimal digits in length */
+- do
+- {
+- digits++;
+- x /= 10;
+- } while(x > 0);
+-
+- cmd_len += strlen(GLOBUS_L_CONTENT_LENGTH_HEADER);
+- cmd_len += digits;
+- cmd = globus_malloc(cmd_len * sizeof(globus_byte_t));
+-
+- if(cmd == GLOBUS_NULL)
+- {
++ cmd_len += strlen(GLOBUS_L_PUT_COMMAND);
++ cmd_len += 2;
++
++ if(proto->text_mode == GLOBUS_TRUE)
++ {
++ cmd_len += strlen(GLOBUS_L_TEXT_HEADER);
++ }
++ else
++ {
++ cmd_len += strlen(GLOBUS_L_BINARY_HEADER);
++ }
++
++ length = globus_gass_transfer_request_get_length(proto->request);
++ if(length != 0)
++ {
++ globus_size_t x = length;
++ globus_size_t digits = 0;
++
++ /* count the number of decimal digits in length */
++ do
++ {
++ digits++;
++ x /= 10;
++ } while(x > 0);
++
++ cmd_len += strlen(GLOBUS_L_CONTENT_LENGTH_HEADER);
++ cmd_len += digits;
++ cmd = globus_malloc(cmd_len * sizeof(globus_byte_t));
++
++ if(cmd == GLOBUS_NULL)
++ {
+ globus_libc_free(url);
+- return GLOBUS_NULL;
+- }
+-
+- sprintf((char *) cmd,
+- GLOBUS_L_PUT_COMMAND,
+- url,
+- proto->url.host);
+-
+- sprintf(cmd + strlen(cmd),
+- GLOBUS_L_CONTENT_LENGTH_HEADER,
+- length);
+- }
+- else
+- {
+- cmd_len += strlen(GLOBUS_L_CHUNKED_HEADER);
+- cmd = globus_malloc(cmd_len * sizeof(globus_byte_t));
+- proto->chunked = GLOBUS_TRUE;
+-
+- /* hex encoding of globus_size_t: two bytes to encode per 8 bits,
+- * plus a CRLF to end the chunk header
+- */
+- proto->iov[0].iov_base = (void *)
+- globus_malloc((sizeof(globus_size_t) * 2) + 2);
+- /* This never changes */
+- proto->iov[2].iov_base = CRLF;
+- proto->iov[2].iov_len = 2;
+- proto->iov[3].iov_base = "0" CRLF CRLF;
+- proto->iov[3].iov_len = strlen("0" CRLF CRLF);
+-
+- if(cmd == GLOBUS_NULL)
+- {
++ return GLOBUS_NULL;
++ }
++
++ sprintf((char *) cmd,
++ GLOBUS_L_PUT_COMMAND,
++ url,
++ proto->url.host);
++
++ sprintf(cmd + strlen(cmd),
++ GLOBUS_L_CONTENT_LENGTH_HEADER,
++ length);
++ }
++ else
++ {
++ cmd_len += strlen(GLOBUS_L_CHUNKED_HEADER);
++ cmd = globus_malloc(cmd_len * sizeof(globus_byte_t));
++ proto->chunked = GLOBUS_TRUE;
++
++ /* hex encoding of globus_size_t: two bytes to encode per 8 bits,
++ * plus a CRLF to end the chunk header
++ */
++ proto->iov[0].iov_base = (void *)
++ globus_malloc((sizeof(globus_size_t) * 2) + 2);
++ /* This never changes */
++ proto->iov[2].iov_base = CRLF;
++ proto->iov[2].iov_len = 2;
++ proto->iov[3].iov_base = "0" CRLF CRLF;
++ proto->iov[3].iov_len = strlen("0" CRLF CRLF);
++
++ if(cmd == GLOBUS_NULL)
++ {
+ globus_libc_free(url);
+- return GLOBUS_NULL;
+- }
+-
+- sprintf((char *) cmd,
+- GLOBUS_L_PUT_COMMAND,
+- url,
+- proto->url.host);
+-
+- strcat(cmd,
+- GLOBUS_L_CHUNKED_HEADER);
+- }
+- if(proto->text_mode)
+- {
+- strcat(cmd,
+- GLOBUS_L_TEXT_HEADER);
+- }
+- else
+- {
+- strcat(cmd,
+- GLOBUS_L_BINARY_HEADER);
+- }
+- strcat(cmd,
+- CRLF);
++ return GLOBUS_NULL;
++ }
++
++ sprintf((char *) cmd,
++ GLOBUS_L_PUT_COMMAND,
++ url,
++ proto->url.host);
++
++ strcat(cmd,
++ GLOBUS_L_CHUNKED_HEADER);
++ }
++ if(proto->text_mode)
++ {
++ strcat(cmd,
++ GLOBUS_L_TEXT_HEADER);
++ }
++ else
++ {
++ strcat(cmd,
++ GLOBUS_L_BINARY_HEADER);
++ }
++ strcat(cmd,
++ CRLF);
+
+ globus_libc_free(url);
+- return cmd;
++ return cmd;
+ case GLOBUS_GASS_TRANSFER_REQUEST_TYPE_APPEND:
+- cmd_len += strlen(GLOBUS_L_APPEND_COMMAND);
+- cmd_len += 2;
+-
+- if(proto->text_mode == GLOBUS_TRUE)
+- {
+- cmd_len += strlen(GLOBUS_L_TEXT_HEADER);
+- }
+- else
+- {
+- cmd_len += strlen(GLOBUS_L_BINARY_HEADER);
+- }
+-
+- length = globus_gass_transfer_request_get_length(proto->request);
+- if(length != 0)
+- {
+- globus_size_t x = length;
+- globus_size_t digits = 0;
+-
+- /* count the number of decimal digits in length */
+- do
+- {
+- digits++;
+- x /= 10;
+- } while(x > 0);
+-
+- cmd_len += strlen(GLOBUS_L_CONTENT_LENGTH_HEADER);
+- cmd_len += digits;
+- cmd = globus_malloc(cmd_len * sizeof(globus_byte_t));
+-
+- if(cmd == GLOBUS_NULL)
+- {
++ cmd_len += strlen(GLOBUS_L_APPEND_COMMAND);
++ cmd_len += 2;
++
++ if(proto->text_mode == GLOBUS_TRUE)
++ {
++ cmd_len += strlen(GLOBUS_L_TEXT_HEADER);
++ }
++ else
++ {
++ cmd_len += strlen(GLOBUS_L_BINARY_HEADER);
++ }
++
++ length = globus_gass_transfer_request_get_length(proto->request);
++ if(length != 0)
++ {
++ globus_size_t x = length;
++ globus_size_t digits = 0;
++
++ /* count the number of decimal digits in length */
++ do
++ {
++ digits++;
++ x /= 10;
++ } while(x > 0);
++
++ cmd_len += strlen(GLOBUS_L_CONTENT_LENGTH_HEADER);
++ cmd_len += digits;
++ cmd = globus_malloc(cmd_len * sizeof(globus_byte_t));
++
++ if(cmd == GLOBUS_NULL)
++ {
+ globus_libc_free(url);
+- return GLOBUS_NULL;
+- }
+-
+- sprintf((char *) cmd,
+- GLOBUS_L_APPEND_COMMAND,
+- url,
+- proto->url.host);
+- sprintf((char *) cmd + strlen(cmd),
+- GLOBUS_L_CONTENT_LENGTH_HEADER,
+- length);
+- }
+- else
+- {
+- cmd_len += strlen(GLOBUS_L_CHUNKED_HEADER);
+- cmd = globus_malloc(cmd_len * sizeof(globus_byte_t));
+- proto->chunked = GLOBUS_TRUE;
+-
+- /* hex encoding of globus_size_t: two bytes to encode per 8 bits,
+- * plus a CRLF to end the chunk header
+- */
+- proto->iov[0].iov_base = (void *)
+- globus_malloc((sizeof(globus_size_t) * 2) + 2);
+- /* This never changes */
+- proto->iov[2].iov_base = CRLF;
+- proto->iov[2].iov_len = 2;
+- proto->iov[3].iov_base = "0" CRLF CRLF;
+- proto->iov[3].iov_len = 5;
+-
+- if(cmd == GLOBUS_NULL)
+- {
++ return GLOBUS_NULL;
++ }
++
++ sprintf((char *) cmd,
++ GLOBUS_L_APPEND_COMMAND,
++ url,
++ proto->url.host);
++ sprintf((char *) cmd + strlen(cmd),
++ GLOBUS_L_CONTENT_LENGTH_HEADER,
++ length);
++ }
++ else
++ {
++ cmd_len += strlen(GLOBUS_L_CHUNKED_HEADER);
++ cmd = globus_malloc(cmd_len * sizeof(globus_byte_t));
++ proto->chunked = GLOBUS_TRUE;
++
++ /* hex encoding of globus_size_t: two bytes to encode per 8 bits,
++ * plus a CRLF to end the chunk header
++ */
++ proto->iov[0].iov_base = (void *)
++ globus_malloc((sizeof(globus_size_t) * 2) + 2);
++ /* This never changes */
++ proto->iov[2].iov_base = CRLF;
++ proto->iov[2].iov_len = 2;
++ proto->iov[3].iov_base = "0" CRLF CRLF;
++ proto->iov[3].iov_len = 5;
++
++ if(cmd == GLOBUS_NULL)
++ {
+ globus_libc_free(url);
+- return GLOBUS_NULL;
+- }
+-
+- sprintf((char *) cmd,
+- GLOBUS_L_APPEND_COMMAND,
+- proto->url.url_path,
+- proto->url.host);
+-
+- strcat(cmd,
+- GLOBUS_L_CHUNKED_HEADER);
+- }
+- if(proto->text_mode)
+- {
+- strcat(cmd,
+- GLOBUS_L_TEXT_HEADER);
+- }
+- else
+- {
+- strcat(cmd,
+- GLOBUS_L_BINARY_HEADER);
+- }
+- strcat(cmd,
+- CRLF);
++ return GLOBUS_NULL;
++ }
++
++ sprintf((char *) cmd,
++ GLOBUS_L_APPEND_COMMAND,
++ proto->url.url_path,
++ proto->url.host);
++
++ strcat(cmd,
++ GLOBUS_L_CHUNKED_HEADER);
++ }
++ if(proto->text_mode)
++ {
++ strcat(cmd,
++ GLOBUS_L_TEXT_HEADER);
++ }
++ else
++ {
++ strcat(cmd,
++ GLOBUS_L_BINARY_HEADER);
++ }
++ strcat(cmd,
++ CRLF);
+
+ globus_libc_free(url);
+- return cmd;
++ return cmd;
+ case GLOBUS_GASS_TRANSFER_REQUEST_TYPE_INVALID:
+ default:
+- globus_assert(proto->type !=
+- GLOBUS_GASS_TRANSFER_REQUEST_TYPE_INVALID);
+- globus_assert(GLOBUS_FALSE);
++ globus_assert(proto->type !=
++ GLOBUS_GASS_TRANSFER_REQUEST_TYPE_INVALID);
++ globus_assert(GLOBUS_FALSE);
+ globus_libc_free(url);
+
+- return GLOBUS_NULL;
+- }
++ return GLOBUS_NULL;
++ }
+ }
+
+ #endif /* !parser only */
+
+ /*
+ * Function: globus_l_gass_transfer_http_parse_response()
+- *
++ *
+ * Description: Parse a byte array containing a (maybe)
+ * partial response from the server.
+- *
++ *
+ * Parameters: Protocol module this pertains to
+- *
++ *
+ * Returns: GLOBUS_TRUE if more headers must be read.
+- *
++ *
+ */
+ static
+ globus_bool_t
+ globus_l_gass_transfer_http_parse_response(
+- globus_gass_transfer_http_request_proto_t * proto)
++ globus_gass_transfer_http_request_proto_t * proto)
+ {
+ /*
+ * Parse the HTTP Response
+@@ -4834,23 +4834,23 @@ globus_l_gass_transfer_http_parse_response(
+ */
+ if(proto->reason == GLOBUS_NULL)
+ {
+- if(globus_l_gass_transfer_http_parse_status_line(proto))
+- {
+- goto repost_read;
+- }
+- else if(proto->parse_error)
+- {
+- goto parse_error;
+- }
++ if(globus_l_gass_transfer_http_parse_status_line(proto))
++ {
++ goto repost_read;
++ }
++ else if(proto->parse_error)
++ {
++ goto parse_error;
++ }
+ }
+
+ if(globus_l_gass_transfer_http_parse_headers(proto))
+ {
+- goto repost_read;
++ goto repost_read;
+ }
+ else if(proto->parse_error)
+ {
+- goto parse_error;
++ goto parse_error;
+ }
+
+ return GLOBUS_FALSE;
+@@ -4865,7 +4865,7 @@ globus_l_gass_transfer_http_parse_response(
+ static
+ globus_bool_t
+ globus_l_gass_transfer_http_parse_request(
+- globus_gass_transfer_http_request_proto_t * proto)
++ globus_gass_transfer_http_request_proto_t * proto)
+ {
+ /*
+ * Parse the HTTP Request
+@@ -4880,23 +4880,23 @@ globus_l_gass_transfer_http_parse_request(
+ */
+ if(proto->method == GLOBUS_NULL)
+ {
+- if(globus_l_gass_transfer_http_parse_request_line(proto))
+- {
+- goto repost_read;
+- }
+- else if(proto->parse_error)
+- {
+- goto parse_error;
+- }
++ if(globus_l_gass_transfer_http_parse_request_line(proto))
++ {
++ goto repost_read;
++ }
++ else if(proto->parse_error)
++ {
++ goto parse_error;
++ }
+ }
+
+ if(globus_l_gass_transfer_http_parse_headers(proto))
+ {
+- goto repost_read;
++ goto repost_read;
+ }
+ else if(proto->parse_error)
+ {
+- goto parse_error;
++ goto parse_error;
+ }
+
+ return GLOBUS_FALSE;
+@@ -4911,11 +4911,11 @@ globus_l_gass_transfer_http_parse_request(
+ static
+ globus_bool_t
+ globus_l_gass_transfer_http_parse_status_line(
+- globus_gass_transfer_http_request_proto_t * proto)
++ globus_gass_transfer_http_request_proto_t * proto)
+ {
+- globus_size_t offset;
+- globus_size_t reason_offset;
+- int r_offset;
++ globus_size_t offset;
++ globus_size_t reason_offset;
++ int r_offset;
+
+ offset = 0;
+ /*
+@@ -4923,41 +4923,41 @@ globus_l_gass_transfer_http_parse_status_line(
+ * HTTP-Version = "HTTP" "/" 1*DIGIT "." 1*DIGIT
+ */
+ if(!globus_l_gass_transfer_http_find_crlf(
+- proto->response_buffer + proto->parsed_offset,
+- proto->response_offset - proto->parsed_offset,
+- &offset))
++ proto->response_buffer + proto->parsed_offset,
++ proto->response_offset - proto->parsed_offset,
++ &offset))
+ {
+- return GLOBUS_TRUE;
++ return GLOBUS_TRUE;
+ }
+ /* Replace CRLF with NULL */
+ proto->response_buffer[proto->parsed_offset + offset] = '\0';
+
+ if(sscanf((char *) proto->response_buffer + proto->parsed_offset,
+- "HTTP/%d.%d %d %n",
+- &proto->major,
+- &proto->minor,
+- &proto->code,
+- &r_offset) != 3)
+- {
+- /* Not a HTTP response */
+- if(proto->code == 0)
+- {
+- proto->code =
+- GLOBUS_L_PROTOCOL_FAILURE_CODE;
+- proto->reason =
+- globus_libc_strdup(GLOBUS_L_PROTOCOL_FAILURE_REASON);
+- }
+- proto->parsed_offset += offset;
+- /* skip the CRLF, as well */
+- proto->parsed_offset+=2;
+-
+- goto parse_error;
++ "HTTP/%d.%d %d %n",
++ &proto->major,
++ &proto->minor,
++ &proto->code,
++ &r_offset) != 3)
++ {
++ /* Not a HTTP response */
++ if(proto->code == 0)
++ {
++ proto->code =
++ GLOBUS_L_PROTOCOL_FAILURE_CODE;
++ proto->reason =
++ globus_libc_strdup(GLOBUS_L_PROTOCOL_FAILURE_REASON);
++ }
++ proto->parsed_offset += offset;
++ /* skip the CRLF, as well */
++ proto->parsed_offset+=2;
++
++ goto parse_error;
+ }
+ reason_offset = (globus_size_t) r_offset;
+
+ proto->reason = globus_libc_strdup((char *) (proto->response_buffer +
+- proto->parsed_offset +
+- reason_offset));
++ proto->parsed_offset +
++ reason_offset));
+ proto->parsed_offset += offset;
+ /* skip the CRLF, as well */
+ proto->parsed_offset+=2;
+@@ -4974,9 +4974,9 @@ globus_l_gass_transfer_http_parse_status_line(
+ static
+ globus_bool_t
+ globus_l_gass_transfer_http_parse_request_line(
+- globus_gass_transfer_http_request_proto_t * proto)
++ globus_gass_transfer_http_request_proto_t * proto)
+ {
+- globus_size_t offset;
++ globus_size_t offset;
+
+ offset = 0;
+ /*
+@@ -4993,11 +4993,11 @@ globus_l_gass_transfer_http_parse_request_line(
+ * extension-method = token
+ */
+ if(!globus_l_gass_transfer_http_find_crlf(
+- proto->response_buffer + proto->parsed_offset,
+- proto->response_offset - proto->parsed_offset,
+- &offset))
++ proto->response_buffer + proto->parsed_offset,
++ proto->response_offset - proto->parsed_offset,
++ &offset))
+ {
+- return GLOBUS_TRUE;
++ return GLOBUS_TRUE;
+ }
+ /* Replace CRLF with NULL */
+ proto->response_buffer[proto->parsed_offset + offset] = '\0';
+@@ -5006,25 +5006,25 @@ globus_l_gass_transfer_http_parse_request_line(
+ proto->uri = globus_malloc(offset);
+
+ if(sscanf((char *) proto->response_buffer + proto->parsed_offset,
+- "%s %s HTTP/%d.%d",
+- proto->method,
+- proto->uri,
+- &proto->major,
+- &proto->minor) != 4)
+- {
+- /* Not a HTTP request */
+- if(proto->code == 0)
+- {
+- proto->code =
+- GLOBUS_L_PROTOCOL_FAILURE_CODE;
+- proto->reason =
+- globus_libc_strdup(GLOBUS_L_PROTOCOL_FAILURE_REASON);
+- }
+- proto->parsed_offset += offset;
+- /* skip the CRLF, as well */
+- proto->parsed_offset+=2;
+-
+- goto parse_error;
++ "%s %s HTTP/%d.%d",
++ proto->method,
++ proto->uri,
++ &proto->major,
++ &proto->minor) != 4)
++ {
++ /* Not a HTTP request */
++ if(proto->code == 0)
++ {
++ proto->code =
++ GLOBUS_L_PROTOCOL_FAILURE_CODE;
++ proto->reason =
++ globus_libc_strdup(GLOBUS_L_PROTOCOL_FAILURE_REASON);
++ }
++ proto->parsed_offset += offset;
++ /* skip the CRLF, as well */
++ proto->parsed_offset+=2;
++
++ goto parse_error;
+ }
+
+ /* skip the CRLF, as well */
+@@ -5041,21 +5041,21 @@ globus_l_gass_transfer_http_parse_request_line(
+ static
+ globus_bool_t
+ globus_l_gass_transfer_http_parse_headers(
+- globus_gass_transfer_http_request_proto_t * proto)
++ globus_gass_transfer_http_request_proto_t * proto)
+ {
+- globus_bool_t all_headers = GLOBUS_FALSE;
++ globus_bool_t all_headers = GLOBUS_FALSE;
+
+ while(!all_headers)
+ {
+- if(globus_l_gass_transfer_http_parse_one_header(proto,
+- &all_headers))
+- {
+- return GLOBUS_TRUE;
+- }
+- else if(proto->parse_error)
+- {
+- return GLOBUS_FALSE;
+- }
++ if(globus_l_gass_transfer_http_parse_one_header(proto,
++ &all_headers))
++ {
++ return GLOBUS_TRUE;
++ }
++ else if(proto->parse_error)
++ {
++ return GLOBUS_FALSE;
++ }
+ }
+ return GLOBUS_FALSE;
+ }
+@@ -5064,22 +5064,22 @@ globus_l_gass_transfer_http_parse_headers(
+ static
+ globus_bool_t
+ globus_l_gass_transfer_http_parse_one_header(
+- globus_gass_transfer_http_request_proto_t * proto,
+- globus_bool_t * last_header)
++ globus_gass_transfer_http_request_proto_t * proto,
++ globus_bool_t * last_header)
+ {
+- globus_size_t offset;
+- globus_bool_t end_of_header;
+- globus_size_t continuation=0;
+- char * value;
+- char * new_value;
+- int i;
++ globus_size_t offset;
++ globus_bool_t end_of_header;
++ globus_size_t continuation=0;
++ char * value;
++ char * new_value;
++ int i;
+
+ /*
+ * message-header = field-name ":" [ field-value ] CRLF
+ *
+ * field-name = token
+ * field-value = *( field-content | LWS )
+- * LWS = [CRLF] 1*( SP | HT )
++ * LWS = [CRLF] 1*( SP | HT )
+ *
+ * field-content = <the OCTETs making up the field-value
+ * and consisting of either *TEXT or combinations
+@@ -5090,7 +5090,7 @@ globus_l_gass_transfer_http_parse_one_header(
+ * tspecials = "(" | ")" | "<" | ">" | "@"
+ * | "," | ";" | ":" | "\" | <">
+ * | "/" | "[" | "]" | "?" | "="
+- * | "{" | "}" | SP | HT
++ * | "{" | "}" | SP | HT
+ *
+ * This implementation is a little lax on the character restrictions...
+ */
+@@ -5100,43 +5100,43 @@ globus_l_gass_transfer_http_parse_one_header(
+ /* Find the complete header (which may span multiple lines) */
+ while(!end_of_header)
+ {
+- /* Find the end of this header line */
+- if(! globus_l_gass_transfer_http_find_crlf(
+- proto->response_buffer +
+- proto->parsed_offset +
+- continuation,
+- proto->response_offset -
+- proto->parsed_offset -
+- continuation,
+- &offset))
+- {
+- return GLOBUS_TRUE;
+- }
+- else if(offset == 0)
+- {
+- end_of_header = GLOBUS_TRUE;
+- break;
+- }
+- /*
+- * Reached end-of-read data before being able to detect a
+- * continuation
+- */
+- if(proto->parsed_offset + continuation + offset + 2 >=
+- proto->response_offset)
+- {
+- return GLOBUS_TRUE;
+- }
+- /* Check for continuation (LWS) */
+- if(islws(proto->response_buffer[proto->parsed_offset +
+- continuation + offset + 2]))
+- {
+- continuation += offset + 2;
+- }
+- else
+- {
+- /* No continuation, we have a header */
+- end_of_header = GLOBUS_TRUE;
+- }
++ /* Find the end of this header line */
++ if(! globus_l_gass_transfer_http_find_crlf(
++ proto->response_buffer +
++ proto->parsed_offset +
++ continuation,
++ proto->response_offset -
++ proto->parsed_offset -
++ continuation,
++ &offset))
++ {
++ return GLOBUS_TRUE;
++ }
++ else if(offset == 0)
++ {
++ end_of_header = GLOBUS_TRUE;
++ break;
++ }
++ /*
++ * Reached end-of-read data before being able to detect a
++ * continuation
++ */
++ if(proto->parsed_offset + continuation + offset + 2 >=
++ proto->response_offset)
++ {
++ return GLOBUS_TRUE;
++ }
++ /* Check for continuation (LWS) */
++ if(islws(proto->response_buffer[proto->parsed_offset +
++ continuation + offset + 2]))
++ {
++ continuation += offset + 2;
++ }
++ else
++ {
++ /* No continuation, we have a header */
++ end_of_header = GLOBUS_TRUE;
++ }
+ }
+
+ /* This is the last header if it consists of CRLF only */
+@@ -5144,40 +5144,40 @@ globus_l_gass_transfer_http_parse_one_header(
+ proto->response_buffer[proto->parsed_offset + 1] == LF &&
+ continuation + offset == 0)
+ {
+- *last_header = GLOBUS_TRUE;
+- proto->parsed_offset += 2;
++ *last_header = GLOBUS_TRUE;
++ proto->parsed_offset += 2;
+
+- return GLOBUS_FALSE;
++ return GLOBUS_FALSE;
+ }
+
+ /* Canonical form of header is lower-case */
+ for(i = proto->parsed_offset; i < proto->parsed_offset + continuation + offset; i++)
+ {
+- if(proto->response_buffer[i] == ':')
+- {
+- break;
+- }
+- else
+- {
+- proto->response_buffer[i] =
+- (char) tolower((int) (proto->response_buffer[i]));
+- }
++ if(proto->response_buffer[i] == ':')
++ {
++ break;
++ }
++ else
++ {
++ proto->response_buffer[i] =
++ (char) tolower((int) (proto->response_buffer[i]));
++ }
+ }
+
+ if(proto->response_buffer[i] != ':')
+ {
+- /* The header's name is illegal */
+- proto->code = GLOBUS_L_PROTOCOL_FAILURE_CODE;
+- if(proto->reason != GLOBUS_NULL)
+- {
+- globus_free(proto->reason);
+- }
+- proto->reason =
+- globus_libc_strdup(GLOBUS_L_PROTOCOL_FAILURE_REASON);
++ /* The header's name is illegal */
++ proto->code = GLOBUS_L_PROTOCOL_FAILURE_CODE;
++ if(proto->reason != GLOBUS_NULL)
++ {
++ globus_free(proto->reason);
++ }
++ proto->reason =
++ globus_libc_strdup(GLOBUS_L_PROTOCOL_FAILURE_REASON);
+
+- proto->parse_error = GLOBUS_TRUE;
++ proto->parse_error = GLOBUS_TRUE;
+
+- return GLOBUS_FALSE;
++ return GLOBUS_FALSE;
+ }
+
+ /* NULL-terminate the header's name */
+@@ -5189,39 +5189,39 @@ globus_l_gass_transfer_http_parse_one_header(
+ proto->response_buffer[proto->parsed_offset+continuation+offset] = '\0';
+
+ /*
+- * Add header to table. If it already there, append a
++ * Add header to table. If it already there, append a
+ * comma and the new header's value.
+ */
+ value = (char *) globus_i_gass_transfer_keyvalue_lookup(
+- &proto->headers,
+- (char *) (proto->response_buffer + proto->parsed_offset));
++ &proto->headers,
++ (char *) (proto->response_buffer + proto->parsed_offset));
+
+ if(value == GLOBUS_NULL)
+ {
+- /* New header */
+- globus_i_gass_transfer_keyvalue_insert(
+- &proto->headers,
+- globus_libc_strdup((char *) (proto->response_buffer +
+- proto->parsed_offset)),
+- globus_libc_strdup(new_value));
++ /* New header */
++ globus_i_gass_transfer_keyvalue_insert(
++ &proto->headers,
++ globus_libc_strdup((char *) (proto->response_buffer +
++ proto->parsed_offset)),
++ globus_libc_strdup(new_value));
+ }
+ else
+ {
+- /* Existing header, append */
+- globus_byte_t * new_ptr;
++ /* Existing header, append */
++ globus_byte_t * new_ptr;
+
+- new_ptr = globus_libc_realloc(value,
+- (strlen(value) +
+- strlen(new_value) + 2) *
+- sizeof(globus_byte_t));
+- strcat((char *) new_ptr,
+- ",");
+- strcat((char *) new_ptr,
+- new_value);
+- globus_i_gass_transfer_keyvalue_replace(
+- &proto->headers,
+- (char *) (proto->response_buffer + proto->parsed_offset),
+- (char *) new_ptr);
++ new_ptr = globus_libc_realloc(value,
++ (strlen(value) +
++ strlen(new_value) + 2) *
++ sizeof(globus_byte_t));
++ strcat((char *) new_ptr,
++ ",");
++ strcat((char *) new_ptr,
++ new_value);
++ globus_i_gass_transfer_keyvalue_replace(
++ &proto->headers,
++ (char *) (proto->response_buffer + proto->parsed_offset),
++ (char *) new_ptr);
+ }
+
+ /* Move the "parsed" pointer to the end of what we've just handled */
+@@ -5234,25 +5234,25 @@ globus_l_gass_transfer_http_parse_one_header(
+ static
+ globus_bool_t
+ globus_l_gass_transfer_http_find_crlf(
+- globus_byte_t * bytes,
+- globus_size_t len,
+- globus_size_t * crlf_offset)
++ globus_byte_t * bytes,
++ globus_size_t len,
++ globus_size_t * crlf_offset)
+ {
+- int i;
++ int i;
+
+ if(len == 0)
+ {
+- return GLOBUS_FALSE;
++ return GLOBUS_FALSE;
+ }
+ /* See if we can find the end an http meta-information line */
+ for (i = 0; i < len-1; i++)
+ {
+- if(bytes[i] == CR &&
+- bytes[i+1] == LF)
+- {
+- *crlf_offset = i;
+- return GLOBUS_TRUE;
+- }
++ if(bytes[i] == CR &&
++ bytes[i+1] == LF)
++ {
++ *crlf_offset = i;
++ return GLOBUS_TRUE;
++ }
+ }
+ return GLOBUS_FALSE;
+ }
+@@ -5260,74 +5260,74 @@ globus_l_gass_transfer_http_find_crlf(
+
+ /*
+ * Function: globus_l_gass_transfer_http_copy_text_buffer()
+- *
++ *
+ * Description: Copy a text array from an HTTP-message to
+ * a user's buffer, converting end-of-line characters
+- * to the local host format. Determines the message
+- * line format based on the first end-of-line it
+- * reaches if it is unknown.
+- *
+- * Parameters:
+- *
+- * Returns:
++ * to the local host format. Determines the message
++ * line format based on the first end-of-line it
++ * reaches if it is unknown.
++ *
++ * Parameters:
++ *
++ * Returns:
+ */
+ void
+ globus_l_gass_transfer_http_copy_text_buffer(
+- globus_byte_t * output,
+- globus_byte_t * input,
+- globus_gass_transfer_http_line_mode_t * line_mode,
+- globus_size_t max_input,
+- globus_size_t max_output,
+- globus_size_t * input_copied,
+- globus_size_t * output_copied)
++ globus_byte_t * output,
++ globus_byte_t * input,
++ globus_gass_transfer_http_line_mode_t * line_mode,
++ globus_size_t max_input,
++ globus_size_t max_output,
++ globus_size_t * input_copied,
++ globus_size_t * output_copied)
+ {
+- globus_size_t src;
+- globus_size_t dst;
++ globus_size_t src;
++ globus_size_t dst;
+ src = 0;
+ dst = 0;
+
+ /* Need to determine the line terminator */
+ if(*line_mode == GLOBUS_L_LINE_MODE_UNKNOWN)
+ {
+- while(src < max_input-1 && dst < max_output-1)
+- {
++ while(src < max_input-1 && dst < max_output-1)
++ {
+ if(input[src] == CR && (*line_mode) ==
+- GLOBUS_L_LINE_MODE_UNKNOWN)
+- {
+- if(input[src+1] == LF)
+- {
+- *line_mode = GLOBUS_L_LINE_MODE_CRLF;
+- break;
+- }
+- else
+- {
+- *line_mode = GLOBUS_L_LINE_MODE_CR;
+- break;
+- }
+- }
+- else if(input[src] == LF && (*line_mode) ==
+- GLOBUS_L_LINE_MODE_UNKNOWN)
+- {
+- *line_mode = GLOBUS_L_LINE_MODE_LF;
+- break;
+- }
+- else
+- {
+- output[dst] = GLOBUS_L_TEXT_BYTE(input[src]);
+- dst++;
+- src++;
+-
+- continue;
+- }
+- }
+- /* did we finish because we read the end-of-input or output? */
+- if(src == max_input-1 ||
+- dst == max_output-1)
+- {
+- *input_copied = src;
+- *output_copied = dst;
+- return;
+- }
++ GLOBUS_L_LINE_MODE_UNKNOWN)
++ {
++ if(input[src+1] == LF)
++ {
++ *line_mode = GLOBUS_L_LINE_MODE_CRLF;
++ break;
++ }
++ else
++ {
++ *line_mode = GLOBUS_L_LINE_MODE_CR;
++ break;
++ }
++ }
++ else if(input[src] == LF && (*line_mode) ==
++ GLOBUS_L_LINE_MODE_UNKNOWN)
++ {
++ *line_mode = GLOBUS_L_LINE_MODE_LF;
++ break;
++ }
++ else
++ {
++ output[dst] = GLOBUS_L_TEXT_BYTE(input[src]);
++ dst++;
++ src++;
++
++ continue;
++ }
++ }
++ /* did we finish because we read the end-of-input or output? */
++ if(src == max_input-1 ||
++ dst == max_output-1)
++ {
++ *input_copied = src;
++ *output_copied = dst;
++ return;
++ }
+ }
+
+ /*
+@@ -5336,102 +5336,102 @@ globus_l_gass_transfer_http_copy_text_buffer(
+ */
+ while(src < max_input && dst < max_output)
+ {
+- if(input[src] == CR && input[src+1] == LF &&
+- *line_mode == GLOBUS_L_LINE_MODE_CRLF)
+- {
+- switch(globus_l_gass_transfer_http_line_mode)
+- {
+- case GLOBUS_L_LINE_MODE_CR:
+- /* CRLF to CR */
+- output[dst] = CR;
+- dst++;
+- src += 2;
+- break;
+- case GLOBUS_L_LINE_MODE_CRLF:
+- /* CRLF to CRLF */
+- output[dst]= CR;
+- dst++;
+- output[dst]= LF;
+- dst++;
+- src += 2;
+- break;
+- case GLOBUS_L_LINE_MODE_LF:
+- /* CRLF to LF */
+- output[dst]= LF;
+- dst++;
+- src += 2;
+- break;
+- case GLOBUS_L_LINE_MODE_UNKNOWN:
+- globus_assert(globus_l_gass_transfer_http_line_mode !=
+- GLOBUS_L_LINE_MODE_UNKNOWN);
+- }
+- }
+- else if(input[src] == CR && *line_mode == GLOBUS_L_LINE_MODE_CR)
+- {
+- switch(globus_l_gass_transfer_http_line_mode)
+- {
+- case GLOBUS_L_LINE_MODE_CR:
+- /* CR to CR */
+- output[dst] = CR;
+- dst++;
+- src++;
+- break;
+- case GLOBUS_L_LINE_MODE_CRLF:
+- /* CR to CRLF */
+- output[dst]= CR;
+- dst++;
+- output[dst]= LF;
+- dst++;
+- src++;
+- break;
+- case GLOBUS_L_LINE_MODE_LF:
+- /* CRLF to LF */
+- output[dst]= LF;
+- dst++;
+- src++;
+- break;
+- case GLOBUS_L_LINE_MODE_UNKNOWN:
+- globus_assert(globus_l_gass_transfer_http_line_mode !=
+- GLOBUS_L_LINE_MODE_UNKNOWN);
+- }
+- }
+- else if(input[src] == LF && *line_mode == GLOBUS_L_LINE_MODE_LF)
+- {
+- switch(globus_l_gass_transfer_http_line_mode)
+- {
+- case GLOBUS_L_LINE_MODE_CR:
+- /* LF to CR */
+- output[dst] = CR;
+- dst++;
+- src++;
+- break;
+- case GLOBUS_L_LINE_MODE_CRLF:
+- /* LF to CRLF */
+- output[dst]= CR;
+- dst++;
+- output[dst]= LF;
+- dst++;
+- src++;
+- break;
+- case GLOBUS_L_LINE_MODE_LF:
+- /* LF to LF */
+- output[dst]= LF;
+- dst++;
+- src++;
+- break;
+- case GLOBUS_L_LINE_MODE_UNKNOWN:
+- globus_assert(globus_l_gass_transfer_http_line_mode !=
+- GLOBUS_L_LINE_MODE_UNKNOWN);
+- }
+- }
+- else
+- {
+- output[dst] = GLOBUS_L_TEXT_BYTE(input[src]);
+- dst++;
+- src++;
+-
+- continue;
+- }
++ if(input[src] == CR && input[src+1] == LF &&
++ *line_mode == GLOBUS_L_LINE_MODE_CRLF)
++ {
++ switch(globus_l_gass_transfer_http_line_mode)
++ {
++ case GLOBUS_L_LINE_MODE_CR:
++ /* CRLF to CR */
++ output[dst] = CR;
++ dst++;
++ src += 2;
++ break;
++ case GLOBUS_L_LINE_MODE_CRLF:
++ /* CRLF to CRLF */
++ output[dst]= CR;
++ dst++;
++ output[dst]= LF;
++ dst++;
++ src += 2;
++ break;
++ case GLOBUS_L_LINE_MODE_LF:
++ /* CRLF to LF */
++ output[dst]= LF;
++ dst++;
++ src += 2;
++ break;
++ case GLOBUS_L_LINE_MODE_UNKNOWN:
++ globus_assert(globus_l_gass_transfer_http_line_mode !=
++ GLOBUS_L_LINE_MODE_UNKNOWN);
++ }
++ }
++ else if(input[src] == CR && *line_mode == GLOBUS_L_LINE_MODE_CR)
++ {
++ switch(globus_l_gass_transfer_http_line_mode)
++ {
++ case GLOBUS_L_LINE_MODE_CR:
++ /* CR to CR */
++ output[dst] = CR;
++ dst++;
++ src++;
++ break;
++ case GLOBUS_L_LINE_MODE_CRLF:
++ /* CR to CRLF */
++ output[dst]= CR;
++ dst++;
++ output[dst]= LF;
++ dst++;
++ src++;
++ break;
++ case GLOBUS_L_LINE_MODE_LF:
++ /* CRLF to LF */
++ output[dst]= LF;
++ dst++;
++ src++;
++ break;
++ case GLOBUS_L_LINE_MODE_UNKNOWN:
++ globus_assert(globus_l_gass_transfer_http_line_mode !=
++ GLOBUS_L_LINE_MODE_UNKNOWN);
++ }
++ }
++ else if(input[src] == LF && *line_mode == GLOBUS_L_LINE_MODE_LF)
++ {
++ switch(globus_l_gass_transfer_http_line_mode)
++ {
++ case GLOBUS_L_LINE_MODE_CR:
++ /* LF to CR */
++ output[dst] = CR;
++ dst++;
++ src++;
++ break;
++ case GLOBUS_L_LINE_MODE_CRLF:
++ /* LF to CRLF */
++ output[dst]= CR;
++ dst++;
++ output[dst]= LF;
++ dst++;
++ src++;
++ break;
++ case GLOBUS_L_LINE_MODE_LF:
++ /* LF to LF */
++ output[dst]= LF;
++ dst++;
++ src++;
++ break;
++ case GLOBUS_L_LINE_MODE_UNKNOWN:
++ globus_assert(globus_l_gass_transfer_http_line_mode !=
++ GLOBUS_L_LINE_MODE_UNKNOWN);
++ }
++ }
++ else
++ {
++ output[dst] = GLOBUS_L_TEXT_BYTE(input[src]);
++ dst++;
++ src++;
++
++ continue;
++ }
+ }
+ *input_copied = src;
+ *output_copied = dst;
+@@ -5441,97 +5441,97 @@ globus_l_gass_transfer_http_copy_text_buffer(
+ static
+ void
+ globus_l_gass_transfer_unbuffer_text(
+- globus_gass_transfer_http_request_proto_t * proto)
++ globus_gass_transfer_http_request_proto_t * proto)
+ {
+ /*
+ * Copy the text from the proto's response buffer to the
+ * user's buffer
+ */
+- globus_size_t input_copied;
+- globus_size_t output_copied;
+- globus_size_t src_max;
+- globus_bool_t redo = GLOBUS_FALSE;
++ globus_size_t input_copied;
++ globus_size_t output_copied;
++ globus_size_t src_max;
++ globus_bool_t redo = GLOBUS_FALSE;
+
+ do
+ {
+- src_max = proto->response_offset - proto->parsed_offset;
++ src_max = proto->response_offset - proto->parsed_offset;
+
+- if(proto->chunked &&
+- (src_max > proto->chunk_left))
+- {
+- src_max = proto->chunk_left;
+- }
++ if(proto->chunked &&
++ (src_max > proto->chunk_left))
++ {
++ src_max = proto->chunk_left;
++ }
+
+ /*
+ * Copy the text, converting to 7-bit US-ASCII, and
+ * converting the document's end-of-line to be the local
+ * machine's end-of-line character
+ */
+- globus_l_gass_transfer_http_copy_text_buffer(
+- proto->user_buffer + proto->user_offset,
+- proto->response_buffer + proto->parsed_offset,
+- &proto->line_mode,
+- src_max,
+- proto->user_buflen - proto->user_offset,
+- &input_copied,
+- &output_copied);
+-
+- proto->user_offset += output_copied;
+- proto->parsed_offset += input_copied;
+- proto->handled += input_copied;
+- if(proto->chunked)
+- {
+- proto->chunk_left -= input_copied;
+- }
+-
+- if(output_copied > proto->user_waitlen)
+- {
+- proto->user_waitlen = 0;
+- }
+- else
+- {
+- proto->user_waitlen -= output_copied;
+- }
+- if(proto->response_offset - proto->parsed_offset == 1 &&
+- proto->line_mode == GLOBUS_L_LINE_MODE_UNKNOWN)
+- {
+- if(proto->response_buffer[proto->parsed_offset] == CR)
+- {
+- proto->line_mode = GLOBUS_L_LINE_MODE_CR;
+- redo = GLOBUS_TRUE;
+- }
+- else if (proto->response_buffer[proto->parsed_offset] == LF)
+- {
+- proto->line_mode = GLOBUS_L_LINE_MODE_LF;
+- redo = GLOBUS_TRUE;
+- }
+- else
+- {
+- /* doesn't matter, since the document contains no newlines */
+- proto->line_mode = GLOBUS_L_LINE_MODE_LF;
+- redo = GLOBUS_TRUE;
+- }
+- }
+- else
+- {
+- redo = GLOBUS_FALSE;
+- }
++ globus_l_gass_transfer_http_copy_text_buffer(
++ proto->user_buffer + proto->user_offset,
++ proto->response_buffer + proto->parsed_offset,
++ &proto->line_mode,
++ src_max,
++ proto->user_buflen - proto->user_offset,
++ &input_copied,
++ &output_copied);
++
++ proto->user_offset += output_copied;
++ proto->parsed_offset += input_copied;
++ proto->handled += input_copied;
++ if(proto->chunked)
++ {
++ proto->chunk_left -= input_copied;
++ }
++
++ if(output_copied > proto->user_waitlen)
++ {
++ proto->user_waitlen = 0;
++ }
++ else
++ {
++ proto->user_waitlen -= output_copied;
++ }
++ if(proto->response_offset - proto->parsed_offset == 1 &&
++ proto->line_mode == GLOBUS_L_LINE_MODE_UNKNOWN)
++ {
++ if(proto->response_buffer[proto->parsed_offset] == CR)
++ {
++ proto->line_mode = GLOBUS_L_LINE_MODE_CR;
++ redo = GLOBUS_TRUE;
++ }
++ else if (proto->response_buffer[proto->parsed_offset] == LF)
++ {
++ proto->line_mode = GLOBUS_L_LINE_MODE_LF;
++ redo = GLOBUS_TRUE;
++ }
++ else
++ {
++ /* doesn't matter, since the document contains no newlines */
++ proto->line_mode = GLOBUS_L_LINE_MODE_LF;
++ redo = GLOBUS_TRUE;
++ }
++ }
++ else
++ {
++ redo = GLOBUS_FALSE;
++ }
+ } while(redo);
+
+ /* Reset our buffer, if we've read it all */
+ if(proto->parsed_offset == proto->response_offset)
+ {
+- proto->parsed_offset = 0;
+- proto->response_offset = 0;
++ proto->parsed_offset = 0;
++ proto->response_offset = 0;
+ }
+ else if(proto->parsed_offset != 0)
+ {
+- /* This may not be necessary */
+- memmove(proto->response_buffer,
+- proto->response_buffer + proto->parsed_offset,
+- proto->response_offset - proto->parsed_offset);
+- proto->response_offset -= proto->parsed_offset;
+- proto->parsed_offset = 0;
++ /* This may not be necessary */
++ memmove(proto->response_buffer,
++ proto->response_buffer + proto->parsed_offset,
++ proto->response_offset - proto->parsed_offset);
++ proto->response_offset -= proto->parsed_offset;
++ proto->parsed_offset = 0;
+ }
+ }
+ /* globus_l_gass_transfer_unbuffer_text() */
+@@ -5539,58 +5539,58 @@ globus_l_gass_transfer_unbuffer_text(
+ static
+ void
+ globus_l_gass_transfer_unbuffer_binary(
+- globus_gass_transfer_http_request_proto_t * proto)
++ globus_gass_transfer_http_request_proto_t * proto)
+ {
+ /*
+ * Copy the binary from the proto's response buffer to the
+ * user's buffer
+ */
+- globus_size_t smaller;
++ globus_size_t smaller;
+
+ smaller = proto->response_offset - proto->parsed_offset;
+ if(smaller > proto->user_buflen - proto->user_offset)
+ {
+- smaller = proto->user_buflen - proto->user_offset;
++ smaller = proto->user_buflen - proto->user_offset;
+ }
+ if(proto->chunked &&
+ smaller > proto->chunk_left)
+ {
+- smaller = proto->chunk_left;
++ smaller = proto->chunk_left;
+ }
+ memcpy(proto->user_buffer + proto->user_offset,
+- proto->response_buffer + proto->parsed_offset,
+- smaller);
++ proto->response_buffer + proto->parsed_offset,
++ smaller);
+
+ proto->user_offset += smaller;
+ proto->parsed_offset += smaller;
+ proto->handled += smaller;
+ if(proto->chunked)
+ {
+- proto->chunk_left -= smaller;
++ proto->chunk_left -= smaller;
+ }
+
+ if(smaller > proto->user_waitlen)
+ {
+- proto->user_waitlen = 0;
++ proto->user_waitlen = 0;
+ }
+ else
+ {
+- proto->user_waitlen -= smaller;
++ proto->user_waitlen -= smaller;
+ }
+ /* Reset our buffer, if we've read it all */
+ if(proto->parsed_offset == proto->response_offset)
+ {
+- proto->parsed_offset = 0;
+- proto->response_offset = 0;
++ proto->parsed_offset = 0;
++ proto->response_offset = 0;
+ }
+ else if(proto->parsed_offset != 0)
+ {
+- /* This may not be necessary */
+- memmove(proto->response_buffer,
+- proto->response_buffer + proto->parsed_offset,
+- proto->response_offset - proto->parsed_offset);
+- proto->response_offset -= proto->parsed_offset;
+- proto->parsed_offset = 0;
++ /* This may not be necessary */
++ memmove(proto->response_buffer,
++ proto->response_buffer + proto->parsed_offset,
++ proto->response_offset - proto->parsed_offset);
++ proto->response_offset -= proto->parsed_offset;
++ proto->parsed_offset = 0;
+ }
+ }
+ /* globus_l_gass_transfer_unbuffer_binary() */
+@@ -5600,17 +5600,17 @@ globus_l_gass_transfer_unbuffer_binary(
+ static
+ globus_bool_t
+ islws(
+- char byte)
++ char byte)
+ {
+ return(byte == ' ' ||
+- byte == '\t');
++ byte == '\t');
+ }
+ /* islws() */
+
+ static
+ globus_bool_t
+ ischar(
+- char byte)
++ char byte)
+ {
+ return( (unsigned char) byte <= 127 );
+ }
+@@ -5619,39 +5619,39 @@ ischar(
+ static
+ globus_bool_t
+ istspecial(
+- char byte)
++ char byte)
+ {
+ return (byte == '(' || byte == ')' || byte == '<' ||
+- byte == '>' || byte == '@' || byte == ',' ||
+- byte == ';' || byte == ':' || byte == '\\' ||
+- byte == '"' || byte == '/' || byte == '[' ||
+- byte == ']' || byte == '?' || byte == '=' ||
+- byte == '{' || byte == '}' || byte == ' ' ||
+- byte == '\t');
++ byte == '>' || byte == '@' || byte == ',' ||
++ byte == ';' || byte == ':' || byte == '\\' ||
++ byte == '"' || byte == '/' || byte == '[' ||
++ byte == ']' || byte == '?' || byte == '=' ||
++ byte == '{' || byte == '}' || byte == ' ' ||
++ byte == '\t');
+ }
+ /* istspecial() */
+
+ globus_bool_t
+ isctl(
+- char byte)
++ char byte)
+ {
+ return ((byte >= (char) 0 && byte <= (char) 31) ||
+- byte == (char) 127);
++ byte == (char) 127);
+ }
+
+ static
+ globus_bool_t
+ ishex(
+- char byte)
++ char byte)
+ {
+ return (byte == 'A' || byte == 'B' || byte == 'C' ||
+- byte == 'D' || byte == 'E' || byte == 'F' ||
+- byte == 'a' || byte == 'b' || byte == 'c' ||
+- byte == 'd' || byte == 'e' || byte == 'f' ||
+- byte == '0' || byte == '1' || byte == '2' ||
+- byte == '3' || byte == '4' || byte == '5' ||
+- byte == '6' || byte == '7' || byte == '8' ||
+- byte == '9');
++ byte == 'D' || byte == 'E' || byte == 'F' ||
++ byte == 'a' || byte == 'b' || byte == 'c' ||
++ byte == 'd' || byte == 'e' || byte == 'f' ||
++ byte == '0' || byte == '1' || byte == '2' ||
++ byte == '3' || byte == '4' || byte == '5' ||
++ byte == '6' || byte == '7' || byte == '8' ||
++ byte == '9');
+ }
+ /*
+ * all scan and parse functions return GLOBUS_TRUE if more data
+@@ -5660,11 +5660,11 @@ ishex(
+ static
+ globus_bool_t
+ globus_l_gass_transfer_http_scan_star_lws(
+- globus_byte_t * input,
+- globus_size_t max_to_scan,
+- globus_size_t * end_of_token)
++ globus_byte_t * input,
++ globus_size_t max_to_scan,
++ globus_size_t * end_of_token)
+ {
+- globus_size_t i;
++ globus_size_t i;
+
+ *end_of_token = 0;
+ /*
+@@ -5689,48 +5689,48 @@ globus_l_gass_transfer_http_scan_star_lws(
+ */
+ for(i = 0; i < max_to_scan; i++)
+ {
+- if(input[i] == ' ' || input[i] == '\t')
+- {
+- continue;
+- }
+- if(input[i] == CR)
+- {
+- if(i + 2 >= max_to_scan)
+- {
+- /* not enough data */
+- return GLOBUS_TRUE;
+- }
+- else
+- {
+- if(input[i+1] == LF &&
+- (input[i+2] == ' ' ||
+- input[i+2] == '\t'))
+- {
+- /* pass over LF */
+- i++;
+- continue;
+- }
+- else
+- {
+- /* This CR doesn't match our pattern */
+- if(i != 0)
+- {
+- /* If we've swallowed any whitespace, note it */
+- *end_of_token = i;
+- }
+- return GLOBUS_FALSE;
+- }
+- }
+- }
+- else
+- {
+- /* end of match */
+- if(i != 0)
+- {
+- *end_of_token = i;
+- }
+- return GLOBUS_FALSE;
+- }
++ if(input[i] == ' ' || input[i] == '\t')
++ {
++ continue;
++ }
++ if(input[i] == CR)
++ {
++ if(i + 2 >= max_to_scan)
++ {
++ /* not enough data */
++ return GLOBUS_TRUE;
++ }
++ else
++ {
++ if(input[i+1] == LF &&
++ (input[i+2] == ' ' ||
++ input[i+2] == '\t'))
++ {
++ /* pass over LF */
++ i++;
++ continue;
++ }
++ else
++ {
++ /* This CR doesn't match our pattern */
++ if(i != 0)
++ {
++ /* If we've swallowed any whitespace, note it */
++ *end_of_token = i;
++ }
++ return GLOBUS_FALSE;
++ }
++ }
++ }
++ else
++ {
++ /* end of match */
++ if(i != 0)
++ {
++ *end_of_token = i;
++ }
++ return GLOBUS_FALSE;
++ }
+ }
+ /*
+ * If we haven't hit an end of the LWS by the end of input,
+@@ -5743,11 +5743,11 @@ globus_l_gass_transfer_http_scan_star_lws(
+ static
+ globus_bool_t
+ globus_l_gass_transfer_http_scan_token(
+- globus_byte_t * input,
+- globus_size_t max_to_scan,
+- globus_size_t * end_of_token)
++ globus_byte_t * input,
++ globus_size_t max_to_scan,
++ globus_size_t * end_of_token)
+ {
+- globus_size_t i;
++ globus_size_t i;
+
+ *end_of_token = 0;
+
+@@ -5758,20 +5758,20 @@ globus_l_gass_transfer_http_scan_token(
+ * tspecials = "(" | ")" | "<" | ">" | "@"
+ * | "," | ";" | ":" | "\" | <">
+ * | "/" | "[" | "]" | "?" | "="
+- * | "{" | "}" | SP | HT
++ * | "{" | "}" | SP | HT
+ */
+ for(i = 0; i < max_to_scan; i++)
+ {
+- if(!ischar(input[i]) ||
+- isctl(input[i]) ||
+- istspecial(input[i]))
+- {
+- if(i != 0)
+- {
+- *end_of_token = i;
+- }
+- return GLOBUS_FALSE;
+- }
++ if(!ischar(input[i]) ||
++ isctl(input[i]) ||
++ istspecial(input[i]))
++ {
++ if(i != 0)
++ {
++ *end_of_token = i;
++ }
++ return GLOBUS_FALSE;
++ }
+ }
+ return GLOBUS_TRUE; /* need more data */
+ }
+@@ -5780,12 +5780,12 @@ globus_l_gass_transfer_http_scan_token(
+ static
+ globus_bool_t
+ globus_l_gass_transfer_http_scan_qdtext(
+- globus_byte_t * input,
+- globus_size_t max_to_scan,
+- globus_size_t * end_of_qdtext)
++ globus_byte_t * input,
++ globus_size_t max_to_scan,
++ globus_size_t * end_of_qdtext)
+ {
+- globus_size_t i;
+- globus_size_t j;
++ globus_size_t i;
++ globus_size_t j;
+
+ /*
+ * qdtext = <any TEXT except <">>
+@@ -5798,54 +5798,54 @@ globus_l_gass_transfer_http_scan_qdtext(
+
+ for(i = 0; i < max_to_scan; i++)
+ {
+- /* Always absorb LWS in quotes */
+- if(globus_l_gass_transfer_http_scan_star_lws(
+- input + i,
+- max_to_scan - i,
+- &j))
+- {
+- return GLOBUS_TRUE; /* need more to scan */
+- }
+- else if(j != 0)
+- {
+- i += j; /* scanned some LWS */
+- continue;
+- }
+- else if(input[i] == '\\')
+- {
+- /* absorb quoted-pair */
+- if(i + 1 < max_to_scan)
+- {
+- if(ischar(input[i+1]))
+- {
+- i++;
+-
+- continue;
+- }
+- else
+- {
+- *end_of_qdtext = i;
+- return GLOBUS_FALSE;
+- }
+- }
+- else
+- {
+- return GLOBUS_TRUE; /* need more to scan */
+- }
+- }
+- else if(!isctl(input[i]))
+- {
+- continue;
+- }
+- else if(i != 0)
+- {
+- *end_of_qdtext = i;
+- return GLOBUS_FALSE;
+- }
+- else
+- {
+- return GLOBUS_FALSE;
+- }
++ /* Always absorb LWS in quotes */
++ if(globus_l_gass_transfer_http_scan_star_lws(
++ input + i,
++ max_to_scan - i,
++ &j))
++ {
++ return GLOBUS_TRUE; /* need more to scan */
++ }
++ else if(j != 0)
++ {
++ i += j; /* scanned some LWS */
++ continue;
++ }
++ else if(input[i] == '\\')
++ {
++ /* absorb quoted-pair */
++ if(i + 1 < max_to_scan)
++ {
++ if(ischar(input[i+1]))
++ {
++ i++;
++
++ continue;
++ }
++ else
++ {
++ *end_of_qdtext = i;
++ return GLOBUS_FALSE;
++ }
++ }
++ else
++ {
++ return GLOBUS_TRUE; /* need more to scan */
++ }
++ }
++ else if(!isctl(input[i]))
++ {
++ continue;
++ }
++ else if(i != 0)
++ {
++ *end_of_qdtext = i;
++ return GLOBUS_FALSE;
++ }
++ else
++ {
++ return GLOBUS_FALSE;
++ }
+ }
+ return GLOBUS_TRUE;
+ }
+@@ -5854,50 +5854,50 @@ globus_l_gass_transfer_http_scan_qdtext(
+ static
+ globus_bool_t
+ globus_l_gass_transfer_http_scan_quoted_string(
+- globus_byte_t * input,
+- globus_size_t max_to_scan,
+- globus_size_t * end_of_qtd_string)
++ globus_byte_t * input,
++ globus_size_t max_to_scan,
++ globus_size_t * end_of_qtd_string)
+ {
+- globus_size_t i;
++ globus_size_t i;
+ /*
+- * quoted-string = ( <"> *(qdtext) <"> )
++ * quoted-string = ( <"> *(qdtext) <"> )
+ */
+
+ *end_of_qtd_string = 0;
+
+ if(max_to_scan == 0)
+ {
+- return GLOBUS_TRUE;
++ return GLOBUS_TRUE;
+ }
+
+ /* quoted text must begin with '"' */
+ if(input[0] != '"')
+ {
+- return GLOBUS_FALSE;
++ return GLOBUS_FALSE;
+ }
+
+ if(globus_l_gass_transfer_http_scan_qdtext(
+- input+1,
+- max_to_scan-1,
+- &i))
++ input+1,
++ max_to_scan-1,
++ &i))
+ {
+- return GLOBUS_TRUE; /* need more data */
++ return GLOBUS_TRUE; /* need more data */
+ }
+
+ if(i == max_to_scan - 1)
+ {
+- return GLOBUS_TRUE; /* need more data */
++ return GLOBUS_TRUE; /* need more data */
+ }
+
+ /* quoted text must end with '"' */
+ if(input[i] == '"')
+ {
+- *end_of_qtd_string = i+1;
+- return GLOBUS_FALSE;
++ *end_of_qtd_string = i+1;
++ return GLOBUS_FALSE;
+ }
+ else
+ {
+- return GLOBUS_FALSE;
++ return GLOBUS_FALSE;
+ }
+ }
+ /* globus_l_gass_transfer_http_scan_quoted_string() */
+@@ -5906,13 +5906,13 @@ globus_l_gass_transfer_http_scan_quoted_string(
+ static
+ globus_bool_t
+ globus_l_gass_transfer_http_scan_chunk_ext(
+- globus_byte_t * input,
+- globus_size_t max_to_scan,
+- globus_size_t * end_of_chunk_ext)
++ globus_byte_t * input,
++ globus_size_t max_to_scan,
++ globus_size_t * end_of_chunk_ext)
+ {
+- globus_size_t i;
+- globus_size_t j;
+- globus_bool_t semicolon = GLOBUS_FALSE;
++ globus_size_t i;
++ globus_size_t j;
++ globus_bool_t semicolon = GLOBUS_FALSE;
+
+ /*
+ * chunk-ext = *( ";" chunk-ext-name [ "=" chunk-ext-value ] )
+@@ -5925,10 +5925,10 @@ globus_l_gass_transfer_http_scan_chunk_ext(
+
+ for(;;)
+ {
+- if(max_to_scan - i == 0)
+- {
+- return GLOBUS_TRUE;
+- }
++ if(max_to_scan - i == 0)
++ {
++ return GLOBUS_TRUE;
++ }
+ else if (input[i] != CR)
+ {
+ /* Don't scan *LWS if the first character is a newline. Assume that no
+@@ -5947,125 +5947,125 @@ globus_l_gass_transfer_http_scan_chunk_ext(
+ }
+ }
+
+- if(i + 1 >= max_to_scan)
+- {
+- return GLOBUS_TRUE;
+- }
+- /*
+- * Only consume LWS if there is a semicolon,
+- * otherwise, we may consume part of CRLF/message body
+- */
+- if(input[i] != ';' && semicolon)
+- {
+- *end_of_chunk_ext = i;
+- return GLOBUS_FALSE;
+- }
+- else if(input[i] != ';')
+- {
+- return GLOBUS_FALSE;
+- }
+-
+- semicolon = GLOBUS_TRUE;
+-
+- /* pass over ';' */
+- i++;
+-
+- /* skip any LWS */
+- if(globus_l_gass_transfer_http_scan_star_lws(
+- input + i,
+- max_to_scan - i,
+- &j))
+- {
+- return GLOBUS_TRUE; /* more to scan */
+- }
+- else if(j != 0)
+- {
+- i += j; /* scanned some LWS */
+- }
+-
+- /* scan for chunk-ext-name */
+- if(globus_l_gass_transfer_http_scan_token(
+- input + i,
+- max_to_scan - i,
+- &j))
+- {
+- return GLOBUS_TRUE;
+- }
+- else if(j == 0) /* illegal, ';' but no token */
+- {
+- *end_of_chunk_ext = 0;
+- return GLOBUS_FALSE;
+- }
+- else
+- {
+- i += j;
+- }
+-
+- /* skip any LWS */
+- if(globus_l_gass_transfer_http_scan_star_lws(
+- input + i,
+- max_to_scan - i,
+- &j))
+- {
+- return GLOBUS_TRUE; /* more to scan */
+- }
+- else if(j != 0)
+- {
+- i += j; /* scanned some leading LWS */
+- }
+-
+- /* check for '=' */
+- if(i + 1 >= max_to_scan)
+- {
+- return GLOBUS_TRUE;
+- }
+- if(input[i] == ';') /* chunk-ext without chunk-ext-value */
+- {
+- continue;
+- }
+- else if(input[i] != '=')
+- {
+- *end_of_chunk_ext = i;
+- return GLOBUS_FALSE;
+- }
+- /* pass over '=' */
+- i++;
+-
+- /* skip any LWS */
+- if(globus_l_gass_transfer_http_scan_star_lws(
+- input+i,
+- max_to_scan-i,
+- &j))
+- {
+- return GLOBUS_TRUE; /* more to scan */
+- }
+- else if(j != 0)
+- {
+- i += j; /* scanned some LWS */
+- }
+-
+-
+- /* check for chunk-ext-value, either a token, or a quoted-string */
+- if(globus_l_gass_transfer_http_scan_token(
+- input + i,
+- max_to_scan - i,
+- &j))
+- {
+- return GLOBUS_TRUE; /* more to scan */
+- }
+- /* no token, try to scan quoted string */
+- else if(j == 0 &&
+- globus_l_gass_transfer_http_scan_quoted_string(
+- input + i,
+- max_to_scan - i,
+- &j))
+- {
+- return GLOBUS_TRUE; /* more to scan */
+- }
+- else
+- {
+- i += j;
+- }
++ if(i + 1 >= max_to_scan)
++ {
++ return GLOBUS_TRUE;
++ }
++ /*
++ * Only consume LWS if there is a semicolon,
++ * otherwise, we may consume part of CRLF/message body
++ */
++ if(input[i] != ';' && semicolon)
++ {
++ *end_of_chunk_ext = i;
++ return GLOBUS_FALSE;
++ }
++ else if(input[i] != ';')
++ {
++ return GLOBUS_FALSE;
++ }
++
++ semicolon = GLOBUS_TRUE;
++
++ /* pass over ';' */
++ i++;
++
++ /* skip any LWS */
++ if(globus_l_gass_transfer_http_scan_star_lws(
++ input + i,
++ max_to_scan - i,
++ &j))
++ {
++ return GLOBUS_TRUE; /* more to scan */
++ }
++ else if(j != 0)
++ {
++ i += j; /* scanned some LWS */
++ }
++
++ /* scan for chunk-ext-name */
++ if(globus_l_gass_transfer_http_scan_token(
++ input + i,
++ max_to_scan - i,
++ &j))
++ {
++ return GLOBUS_TRUE;
++ }
++ else if(j == 0) /* illegal, ';' but no token */
++ {
++ *end_of_chunk_ext = 0;
++ return GLOBUS_FALSE;
++ }
++ else
++ {
++ i += j;
++ }
++
++ /* skip any LWS */
++ if(globus_l_gass_transfer_http_scan_star_lws(
++ input + i,
++ max_to_scan - i,
++ &j))
++ {
++ return GLOBUS_TRUE; /* more to scan */
++ }
++ else if(j != 0)
++ {
++ i += j; /* scanned some leading LWS */
++ }
++
++ /* check for '=' */
++ if(i + 1 >= max_to_scan)
++ {
++ return GLOBUS_TRUE;
++ }
++ if(input[i] == ';') /* chunk-ext without chunk-ext-value */
++ {
++ continue;
++ }
++ else if(input[i] != '=')
++ {
++ *end_of_chunk_ext = i;
++ return GLOBUS_FALSE;
++ }
++ /* pass over '=' */
++ i++;
++
++ /* skip any LWS */
++ if(globus_l_gass_transfer_http_scan_star_lws(
++ input+i,
++ max_to_scan-i,
++ &j))
++ {
++ return GLOBUS_TRUE; /* more to scan */
++ }
++ else if(j != 0)
++ {
++ i += j; /* scanned some LWS */
++ }
++
++
++ /* check for chunk-ext-value, either a token, or a quoted-string */
++ if(globus_l_gass_transfer_http_scan_token(
++ input + i,
++ max_to_scan - i,
++ &j))
++ {
++ return GLOBUS_TRUE; /* more to scan */
++ }
++ /* no token, try to scan quoted string */
++ else if(j == 0 &&
++ globus_l_gass_transfer_http_scan_quoted_string(
++ input + i,
++ max_to_scan - i,
++ &j))
++ {
++ return GLOBUS_TRUE; /* more to scan */
++ }
++ else
++ {
++ i += j;
++ }
+ }
+ }
+ /* globus_l_gass_transfer_http_scan_chunk_ext() */
+@@ -6073,11 +6073,11 @@ globus_l_gass_transfer_http_scan_chunk_ext(
+ static
+ globus_bool_t
+ globus_l_gass_transfer_http_scan_chunk_size(
+- globus_byte_t * input,
+- globus_size_t max_to_scan,
+- globus_size_t * end_of_chunk_size)
++ globus_byte_t * input,
++ globus_size_t max_to_scan,
++ globus_size_t * end_of_chunk_size)
+ {
+- globus_size_t i;
++ globus_size_t i;
+
+ /*
+ * hex-no-zero = <HEX excluding "0">
+@@ -6089,28 +6089,28 @@ globus_l_gass_transfer_http_scan_chunk_size(
+
+ if(i >= max_to_scan)
+ {
+- return GLOBUS_TRUE;
++ return GLOBUS_TRUE;
+ }
+
+ if(input[i] == '0' &&
+ i + 1 < max_to_scan)
+ {
+- *end_of_chunk_size = 1;
+- return GLOBUS_FALSE;
++ *end_of_chunk_size = 1;
++ return GLOBUS_FALSE;
+ }
+
+ for(; i < max_to_scan; i++)
+ {
+- if(input[i] == ' ' ||
+- input[i] == '\t')
+- {
+- continue;
+- }
+- if(!ishex(input[i]))
+- {
+- *end_of_chunk_size = i;
+- return GLOBUS_FALSE;
+- }
++ if(input[i] == ' ' ||
++ input[i] == '\t')
++ {
++ continue;
++ }
++ if(!ishex(input[i]))
++ {
++ *end_of_chunk_size = i;
++ return GLOBUS_FALSE;
++ }
+ }
+ return GLOBUS_TRUE;
+ }
+@@ -6118,21 +6118,21 @@ globus_l_gass_transfer_http_scan_chunk_size(
+
+ /*
+ * Function: globus_l_gass_transfer_http_handle_chunk()
+- *
++ *
+ * Description: Parse any chunk header/footer information, and
+ * copy chunk data (with appropriate text-mode
+ * translations) into the user's buffers
+- *
+- * Parameters:
+- *
+- * Returns:
++ *
++ * Parameters:
++ *
++ * Returns:
+ */
+ static
+ globus_bool_t
+ globus_l_gass_transfer_http_handle_chunk(
+- globus_gass_transfer_http_request_proto_t * proto)
++ globus_gass_transfer_http_request_proto_t * proto)
+ {
+- globus_size_t i;
++ globus_size_t i;
+
+ if ( proto->response_offset - proto->parsed_offset == 0 )
+ {
+@@ -6145,16 +6145,16 @@ globus_l_gass_transfer_http_handle_chunk(
+ switch(proto->recv_state)
+ {
+ case GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_UNTIL_LENGTH:
+- if (proto->length == proto->handled)
+- {
+- proto->recv_state =
+- GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_EOF;
+- }
+- else
+- {
+- proto->recv_state =
+- GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_ERROR;
+- }
++ if (proto->length == proto->handled)
++ {
++ proto->recv_state =
++ GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_EOF;
++ }
++ else
++ {
++ proto->recv_state =
++ GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_ERROR;
++ }
+ break;
+
+ case GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_UNTIL_EOF:
+@@ -6164,8 +6164,8 @@ globus_l_gass_transfer_http_handle_chunk(
+
+ default:
+ proto->failure_occurred = GLOBUS_TRUE;
+- proto->recv_state =
+- GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_ERROR;
++ proto->recv_state =
++ GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_ERROR;
+ break;
+ }
+ return GLOBUS_FALSE;
+@@ -6174,229 +6174,229 @@ globus_l_gass_transfer_http_handle_chunk(
+
+ while(proto->response_offset - proto->parsed_offset > 0)
+ {
+- switch(proto->recv_state)
+- {
+- case GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_CHUNK_SIZE:
+- if(globus_l_gass_transfer_http_scan_chunk_size(
+- proto->response_buffer + proto->parsed_offset,
+- proto->response_offset - proto->parsed_offset,
+- &i))
+- {
+- /* true == need more data */
+- return GLOBUS_TRUE;
+- }
+- else if(i == 0)
+- {
+- proto->recv_state =
+- GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_ERROR;
+- proto->failure_occurred =
+- GLOBUS_TRUE;
+- return GLOBUS_FALSE;
+- }
+-
+- proto->chunk_left = strtoul((char *) proto->response_buffer +
+- proto->parsed_offset,
+- GLOBUS_NULL,
+- 16);
+- proto->parsed_offset += i;
+- if(proto->chunk_left == 0)
+- {
+- /*
+- * last chunk can not be followed by chunk-ext elements,
+- * but may be followed by a set of footers
+- */
+- proto->recv_state =
+- GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_CHUNK_FOOTER;
+- break;
+- }
+- else
+- {
+- proto->recv_state =
+- GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_CHUNK_EXT;
+- }
+- /* FALLSTHROUGH */
+- case GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_CHUNK_EXT:
+- if(globus_l_gass_transfer_http_scan_chunk_ext(
+- proto->response_buffer + proto->parsed_offset,
+- proto->response_offset - proto->parsed_offset,
+- &i))
+- {
+- /* true == need more data */
+- return GLOBUS_TRUE;
+- }
+- else
+- {
+- proto->parsed_offset += i;
+- proto->recv_state =
+- GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_CHUNK_END_HEADER_CR;
+- /* FALLSTHROUGH */
+- }
+- case GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_CHUNK_END_HEADER_CR:
+- if(proto->response_offset - proto->parsed_offset > 0)
+- {
+- if(proto->response_buffer[proto->parsed_offset] != CR)
+- {
+- proto->parse_error=GLOBUS_TRUE;
+- proto->failure_occurred = GLOBUS_TRUE;
+- proto->recv_state =
+- GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_ERROR;
+- return GLOBUS_FALSE;
+- }
+- proto->recv_state =
+- GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_CHUNK_END_HEADER_LF;
+- proto->parsed_offset++;
+- }
+- else
+- {
+- return GLOBUS_TRUE;
+- }
+- /* FALLSTHROUGH */
+- case GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_CHUNK_END_HEADER_LF:
+- if(proto->response_offset - proto->parsed_offset > 0)
+- {
+- if(proto->response_buffer[proto->parsed_offset] != LF)
+- {
+- proto->parse_error=GLOBUS_TRUE;
+- proto->failure_occurred=GLOBUS_TRUE;
+- return GLOBUS_FALSE;
+- }
+- proto->recv_state =
+- GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_CHUNK_BODY;
+- proto->parsed_offset++;
+- }
+- else
+- {
+- return GLOBUS_TRUE;
+- }
+- /* FALLSTHROUGH */
+- case GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_CHUNK_BODY:
+- if(proto->chunk_left == 0)
+- {
+- proto->recv_state =
+- GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_CHUNK_END_BODY_CR;
+- }
+- else
+- {
+- break;
+- }
+- /* FALLSTHROUGH */
+-
+- case GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_CHUNK_END_BODY_CR:
+- if(proto->response_offset - proto->parsed_offset > 0)
+- {
+- if(proto->response_buffer[proto->parsed_offset] != CR)
+- {
+- proto->parse_error=GLOBUS_TRUE;
+- proto->failure_occurred=GLOBUS_TRUE;
+- proto->recv_state =
+- GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_ERROR;
+- return GLOBUS_FALSE;
+- }
+- proto->recv_state =
+- GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_CHUNK_END_BODY_LF;
+- proto->parsed_offset++;
+- }
+- else
+- {
+- return GLOBUS_TRUE;
+- }
+- /* FALLSTHROUGH */
+-
+- case GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_CHUNK_END_BODY_LF:
+- if(proto->response_offset - proto->parsed_offset > 0)
+- {
+- if(proto->response_buffer[proto->parsed_offset] != LF)
+- {
+- proto->parse_error=GLOBUS_TRUE;
+- proto->failure_occurred=GLOBUS_TRUE;
+- proto->recv_state =
+- GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_ERROR;
+- return GLOBUS_FALSE;
+- }
+- proto->recv_state =
+- GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_CHUNK_SIZE;
+- proto->parsed_offset++;
+- break;
+- }
+- else
+- {
+- return GLOBUS_TRUE;
+- }
+- case GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_CHUNK_FOOTER:
+- if(globus_l_gass_transfer_http_parse_headers(proto))
+- {
+- /* need more data */
+- return GLOBUS_TRUE;
+- }
+- else if(proto->parse_error)
+- {
+- proto->failure_occurred=GLOBUS_TRUE;
+- proto->recv_state =
+- GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_ERROR;
+- return GLOBUS_FALSE;
+- }
+- else
+- {
+- proto->recv_state =
+- GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_EOF;
+- return GLOBUS_FALSE;
+- }
+- case GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_UNTIL_EOF:
+- case GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_UNTIL_LENGTH:
+- break;
+-
+- case GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_ERROR:
+- case GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_EOF:
+- return GLOBUS_FALSE;
+- }
+-
+- if(proto->recv_state ==
+- GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_UNTIL_LENGTH ||
+- proto->recv_state ==
+- GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_UNTIL_EOF ||
+- proto->recv_state ==
+- GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_CHUNK_BODY)
+- {
+- if(proto->user_buflen > proto->user_offset &&
+- proto->response_offset > proto->parsed_offset)
+- {
+- /* some room is in the user's buffer for new data */
+- if(proto->text_mode)
+- {
+- globus_l_gass_transfer_unbuffer_text(proto);
+- }
+- else
+- {
+- globus_l_gass_transfer_unbuffer_binary(proto);
+- }
+- /* check to see if we've failed/completed because of this */
+- if(proto->recv_state == GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_UNTIL_LENGTH &&
+- proto->length == proto->handled)
+- {
+- proto->recv_state =
+- GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_EOF;
+- }
+- else if(proto->recv_state == GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_UNTIL_LENGTH &&
+- proto->eof_read &&
+- proto->response_offset - proto->parsed_offset == 0)
+- {
+- proto->recv_state =
+- GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_ERROR;
+- }
+- else if(proto->recv_state == GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_UNTIL_EOF &&
+- proto->eof_read &&
+- proto->response_offset - proto->parsed_offset == 0)
+- {
+- proto->recv_state =
+- GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_EOF;
+- }
+-
+- }
+- else
+- {
+- return GLOBUS_FALSE;
+- }
+- }
++ switch(proto->recv_state)
++ {
++ case GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_CHUNK_SIZE:
++ if(globus_l_gass_transfer_http_scan_chunk_size(
++ proto->response_buffer + proto->parsed_offset,
++ proto->response_offset - proto->parsed_offset,
++ &i))
++ {
++ /* true == need more data */
++ return GLOBUS_TRUE;
++ }
++ else if(i == 0)
++ {
++ proto->recv_state =
++ GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_ERROR;
++ proto->failure_occurred =
++ GLOBUS_TRUE;
++ return GLOBUS_FALSE;
++ }
++
++ proto->chunk_left = strtoul((char *) proto->response_buffer +
++ proto->parsed_offset,
++ GLOBUS_NULL,
++ 16);
++ proto->parsed_offset += i;
++ if(proto->chunk_left == 0)
++ {
++ /*
++ * last chunk can not be followed by chunk-ext elements,
++ * but may be followed by a set of footers
++ */
++ proto->recv_state =
++ GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_CHUNK_FOOTER;
++ break;
++ }
++ else
++ {
++ proto->recv_state =
++ GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_CHUNK_EXT;
++ }
++ /* FALLSTHROUGH */
++ case GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_CHUNK_EXT:
++ if(globus_l_gass_transfer_http_scan_chunk_ext(
++ proto->response_buffer + proto->parsed_offset,
++ proto->response_offset - proto->parsed_offset,
++ &i))
++ {
++ /* true == need more data */
++ return GLOBUS_TRUE;
++ }
++ else
++ {
++ proto->parsed_offset += i;
++ proto->recv_state =
++ GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_CHUNK_END_HEADER_CR;
++ /* FALLSTHROUGH */
++ }
++ case GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_CHUNK_END_HEADER_CR:
++ if(proto->response_offset - proto->parsed_offset > 0)
++ {
++ if(proto->response_buffer[proto->parsed_offset] != CR)
++ {
++ proto->parse_error=GLOBUS_TRUE;
++ proto->failure_occurred = GLOBUS_TRUE;
++ proto->recv_state =
++ GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_ERROR;
++ return GLOBUS_FALSE;
++ }
++ proto->recv_state =
++ GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_CHUNK_END_HEADER_LF;
++ proto->parsed_offset++;
++ }
++ else
++ {
++ return GLOBUS_TRUE;
++ }
++ /* FALLSTHROUGH */
++ case GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_CHUNK_END_HEADER_LF:
++ if(proto->response_offset - proto->parsed_offset > 0)
++ {
++ if(proto->response_buffer[proto->parsed_offset] != LF)
++ {
++ proto->parse_error=GLOBUS_TRUE;
++ proto->failure_occurred=GLOBUS_TRUE;
++ return GLOBUS_FALSE;
++ }
++ proto->recv_state =
++ GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_CHUNK_BODY;
++ proto->parsed_offset++;
++ }
++ else
++ {
++ return GLOBUS_TRUE;
++ }
++ /* FALLSTHROUGH */
++ case GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_CHUNK_BODY:
++ if(proto->chunk_left == 0)
++ {
++ proto->recv_state =
++ GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_CHUNK_END_BODY_CR;
++ }
++ else
++ {
++ break;
++ }
++ /* FALLSTHROUGH */
++
++ case GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_CHUNK_END_BODY_CR:
++ if(proto->response_offset - proto->parsed_offset > 0)
++ {
++ if(proto->response_buffer[proto->parsed_offset] != CR)
++ {
++ proto->parse_error=GLOBUS_TRUE;
++ proto->failure_occurred=GLOBUS_TRUE;
++ proto->recv_state =
++ GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_ERROR;
++ return GLOBUS_FALSE;
++ }
++ proto->recv_state =
++ GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_CHUNK_END_BODY_LF;
++ proto->parsed_offset++;
++ }
++ else
++ {
++ return GLOBUS_TRUE;
++ }
++ /* FALLSTHROUGH */
++
++ case GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_CHUNK_END_BODY_LF:
++ if(proto->response_offset - proto->parsed_offset > 0)
++ {
++ if(proto->response_buffer[proto->parsed_offset] != LF)
++ {
++ proto->parse_error=GLOBUS_TRUE;
++ proto->failure_occurred=GLOBUS_TRUE;
++ proto->recv_state =
++ GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_ERROR;
++ return GLOBUS_FALSE;
++ }
++ proto->recv_state =
++ GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_CHUNK_SIZE;
++ proto->parsed_offset++;
++ break;
++ }
++ else
++ {
++ return GLOBUS_TRUE;
++ }
++ case GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_CHUNK_FOOTER:
++ if(globus_l_gass_transfer_http_parse_headers(proto))
++ {
++ /* need more data */
++ return GLOBUS_TRUE;
++ }
++ else if(proto->parse_error)
++ {
++ proto->failure_occurred=GLOBUS_TRUE;
++ proto->recv_state =
++ GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_ERROR;
++ return GLOBUS_FALSE;
++ }
++ else
++ {
++ proto->recv_state =
++ GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_EOF;
++ return GLOBUS_FALSE;
++ }
++ case GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_UNTIL_EOF:
++ case GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_UNTIL_LENGTH:
++ break;
++
++ case GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_ERROR:
++ case GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_EOF:
++ return GLOBUS_FALSE;
++ }
++
++ if(proto->recv_state ==
++ GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_UNTIL_LENGTH ||
++ proto->recv_state ==
++ GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_UNTIL_EOF ||
++ proto->recv_state ==
++ GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_CHUNK_BODY)
++ {
++ if(proto->user_buflen > proto->user_offset &&
++ proto->response_offset > proto->parsed_offset)
++ {
++ /* some room is in the user's buffer for new data */
++ if(proto->text_mode)
++ {
++ globus_l_gass_transfer_unbuffer_text(proto);
++ }
++ else
++ {
++ globus_l_gass_transfer_unbuffer_binary(proto);
++ }
++ /* check to see if we've failed/completed because of this */
++ if(proto->recv_state == GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_UNTIL_LENGTH &&
++ proto->length == proto->handled)
++ {
++ proto->recv_state =
++ GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_EOF;
++ }
++ else if(proto->recv_state == GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_UNTIL_LENGTH &&
++ proto->eof_read &&
++ proto->response_offset - proto->parsed_offset == 0)
++ {
++ proto->recv_state =
++ GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_ERROR;
++ }
++ else if(proto->recv_state == GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_UNTIL_EOF &&
++ proto->eof_read &&
++ proto->response_offset - proto->parsed_offset == 0)
++ {
++ proto->recv_state =
++ GLOBUS_GASS_TRANSFER_HTTP_RECV_STATE_EOF;
++ }
++
++ }
++ else
++ {
++ return GLOBUS_FALSE;
++ }
++ }
+ }
+ return GLOBUS_FALSE;
+ }
+@@ -6405,37 +6405,37 @@ globus_l_gass_transfer_http_handle_chunk(
+ static
+ void
+ globus_l_gass_transfer_http_extract_referral(
+- globus_gass_transfer_http_request_proto_t * proto,
+- char *** referral,
+- globus_size_t * referral_count)
++ globus_gass_transfer_http_request_proto_t * proto,
++ char *** referral,
++ globus_size_t * referral_count)
+ {
+- char * location;
+- char * p;
++ char * location;
++ char * p;
+
+ location = globus_i_gass_transfer_keyvalue_lookup(
+- &proto->headers,
+- "location");
++ &proto->headers,
++ "location");
+ if(location == GLOBUS_NULL)
+ {
+- *referral = GLOBUS_NULL;
+- *referral_count = 0;
++ *referral = GLOBUS_NULL;
++ *referral_count = 0;
+ }
+ else
+ {
+- p = location;
++ p = location;
+
+- for(p=location; *p != '\0'; p++)
+- {
+- if(!isspace(*p))
+- {
+- break;
+- }
+- }
++ for(p=location; *p != '\0'; p++)
++ {
++ if(!isspace(*p))
++ {
++ break;
++ }
++ }
+
+- *referral = (char **) globus_malloc(sizeof(char *));
+- (*referral)[0] = globus_libc_strdup(p);
++ *referral = (char **) globus_malloc(sizeof(char *));
++ (*referral)[0] = globus_libc_strdup(p);
+
+- *referral_count = 1;
++ *referral_count = 1;
+ }
+ return;
+ }
+@@ -6462,17 +6462,17 @@ globus_l_gass_transfer_http_accept_failed_kickout(
+ static
+ void
+ globus_l_gass_transfer_http_callback_denied(
+- void * arg)
++ void * arg)
+ {
+- globus_gass_transfer_request_t request;
++ globus_gass_transfer_request_t request;
+
+ request = (globus_gass_transfer_request_t) (intptr_t) arg;
+-
++
+ debug_printf(2, (_GTSL("calling globus_gass_transfer_proto_request_denied")));
+ globus_gass_transfer_proto_request_denied(
+- request,
+- GLOBUS_L_DEFAULT_FAILURE_CODE,
+- globus_libc_strdup(GLOBUS_L_DEFAULT_FAILURE_REASON));
++ request,
++ GLOBUS_L_DEFAULT_FAILURE_CODE,
++ globus_libc_strdup(GLOBUS_L_DEFAULT_FAILURE_REASON));
+ }
+ #endif /* !GLOBUS_GASS_TRANSFER_HTTP_PARSER_TEST */
+ #endif /* GLOBUS_DONT_DOCUMENT_INTERNAL */
+diff --git a/gass/transfer/source/library/globus_gass_transfer_request.c b/gass/transfer/source/library/globus_gass_transfer_request.c
+index d025dde9d..eb21fbb98 100644
+--- a/gass/transfer/source/library/globus_gass_transfer_request.c
++++ b/gass/transfer/source/library/globus_gass_transfer_request.c
+@@ -20,7 +20,7 @@
+ * @brief GASS Transfer Request
+ *
+ * This module implements the request structure accessors for the
+- * GASS transfer library
++ * GASS transfer library
+ */
+ #endif
+
+@@ -41,20 +41,20 @@
+ */
+ globus_gass_transfer_request_type_t
+ globus_gass_transfer_request_get_type(
+- globus_gass_transfer_request_t request)
++ globus_gass_transfer_request_t request)
+ {
+- globus_gass_transfer_request_struct_t * req;
++ globus_gass_transfer_request_struct_t * req;
+
+ req =
+- globus_handle_table_lookup(&globus_i_gass_transfer_request_handles,
+- request);
++ globus_handle_table_lookup(&globus_i_gass_transfer_request_handles,
++ request);
+ if(req == GLOBUS_NULL)
+ {
+- return GLOBUS_GASS_TRANSFER_REQUEST_TYPE_INVALID;
++ return GLOBUS_GASS_TRANSFER_REQUEST_TYPE_INVALID;
+ }
+ else
+ {
+- return req->type;
++ return req->type;
+ }
+ }
+ /* globus_gass_transfer_request_get_type() */
+@@ -75,21 +75,21 @@ globus_gass_transfer_request_get_type(
+ */
+ void *
+ globus_gass_transfer_request_get_user_pointer(
+- globus_gass_transfer_request_t request)
++ globus_gass_transfer_request_t request)
+ {
+- globus_gass_transfer_request_struct_t * req;
++ globus_gass_transfer_request_struct_t * req;
+
+ req =
+- globus_handle_table_lookup(&globus_i_gass_transfer_request_handles,
+- request);
++ globus_handle_table_lookup(&globus_i_gass_transfer_request_handles,
++ request);
+ if(req == GLOBUS_NULL||
+ req->type == GLOBUS_GASS_TRANSFER_REQUEST_TYPE_INVALID)
+ {
+- return GLOBUS_NULL;
++ return GLOBUS_NULL;
+ }
+ else
+ {
+- return req->user_pointer;
++ return req->user_pointer;
+ }
+ }
+ /* globus_gass_transfer_request_get_user_pointer() */
+@@ -115,22 +115,22 @@ globus_gass_transfer_request_get_user_pointer(
+ */
+ int
+ globus_gass_transfer_request_set_user_pointer(
+- globus_gass_transfer_request_t request,
+- void * user_pointer)
++ globus_gass_transfer_request_t request,
++ void * user_pointer)
+ {
+- globus_gass_transfer_request_struct_t * req;
++ globus_gass_transfer_request_struct_t * req;
+
+ req =
+- globus_handle_table_lookup(&globus_i_gass_transfer_request_handles,
+- request);
++ globus_handle_table_lookup(&globus_i_gass_transfer_request_handles,
++ request);
+ if(req == GLOBUS_NULL)
+ {
+- return GLOBUS_GASS_TRANSFER_ERROR_INVALID_USE;
++ return GLOBUS_GASS_TRANSFER_ERROR_INVALID_USE;
+ }
+ else
+ {
+- req->user_pointer = user_pointer;
+- return GLOBUS_SUCCESS;
++ req->user_pointer = user_pointer;
++ return GLOBUS_SUCCESS;
+ }
+ }
+ /* globus_gass_transfer_request_set_user_pointer() */
+@@ -153,46 +153,46 @@ globus_gass_transfer_request_set_user_pointer(
+ */
+ globus_gass_transfer_request_status_t
+ globus_gass_transfer_request_get_status(
+- globus_gass_transfer_request_t request)
++ globus_gass_transfer_request_t request)
+ {
+- globus_gass_transfer_request_struct_t * req;
++ globus_gass_transfer_request_struct_t * req;
+
+ req =
+- globus_handle_table_lookup(&globus_i_gass_transfer_request_handles,
+- request);
++ globus_handle_table_lookup(&globus_i_gass_transfer_request_handles,
++ request);
+ if(req != GLOBUS_NULL)
+ {
+- switch(req->status)
+- {
+- case GLOBUS_GASS_TRANSFER_REQUEST_STARTING3:
+- case GLOBUS_GASS_TRANSFER_REQUEST_PENDING:
+- case GLOBUS_GASS_TRANSFER_REQUEST_ACTING:
+- case GLOBUS_GASS_TRANSFER_REQUEST_ACTING_TO_PENDING:
+- case GLOBUS_GASS_TRANSFER_REQUEST_ACCEPTING:
+- return GLOBUS_GASS_TRANSFER_REQUEST_PENDING;
+- case GLOBUS_GASS_TRANSFER_REQUEST_ACTING_TO_FAILING:
+- case GLOBUS_GASS_TRANSFER_REQUEST_FAILING:
+- case GLOBUS_GASS_TRANSFER_REQUEST_FAILED:
+- case GLOBUS_GASS_TRANSFER_REQUEST_SERVER_FAIL1:
+- case GLOBUS_GASS_TRANSFER_REQUEST_SERVER_FAIL2:
+- case GLOBUS_GASS_TRANSFER_REQUEST_SERVER_FAIL3:
+- case GLOBUS_GASS_TRANSFER_REQUEST_USER_FAIL:
+- return GLOBUS_GASS_TRANSFER_REQUEST_FAILED;
+- case GLOBUS_GASS_TRANSFER_REQUEST_FINISHING:
+- case GLOBUS_GASS_TRANSFER_REQUEST_DONE:
+- return GLOBUS_GASS_TRANSFER_REQUEST_DONE;
+- case GLOBUS_GASS_TRANSFER_REQUEST_STARTING:
+- case GLOBUS_GASS_TRANSFER_REQUEST_STARTING2:
+- return GLOBUS_GASS_TRANSFER_REQUEST_STARTING;
+- case GLOBUS_GASS_TRANSFER_REQUEST_REFERRED:
+- case GLOBUS_GASS_TRANSFER_REQUEST_ACTING_TO_REFERRING:
+- case GLOBUS_GASS_TRANSFER_REQUEST_REFERRING:
+- return GLOBUS_GASS_TRANSFER_REQUEST_REFERRED;
+- case GLOBUS_GASS_TRANSFER_REQUEST_DENIED:
+- return GLOBUS_GASS_TRANSFER_REQUEST_DENIED;
+- case GLOBUS_GASS_TRANSFER_REQUEST_INVALID:
+- return GLOBUS_GASS_TRANSFER_REQUEST_INVALID;
+- }
++ switch(req->status)
++ {
++ case GLOBUS_GASS_TRANSFER_REQUEST_STARTING3:
++ case GLOBUS_GASS_TRANSFER_REQUEST_PENDING:
++ case GLOBUS_GASS_TRANSFER_REQUEST_ACTING:
++ case GLOBUS_GASS_TRANSFER_REQUEST_ACTING_TO_PENDING:
++ case GLOBUS_GASS_TRANSFER_REQUEST_ACCEPTING:
++ return GLOBUS_GASS_TRANSFER_REQUEST_PENDING;
++ case GLOBUS_GASS_TRANSFER_REQUEST_ACTING_TO_FAILING:
++ case GLOBUS_GASS_TRANSFER_REQUEST_FAILING:
++ case GLOBUS_GASS_TRANSFER_REQUEST_FAILED:
++ case GLOBUS_GASS_TRANSFER_REQUEST_SERVER_FAIL1:
++ case GLOBUS_GASS_TRANSFER_REQUEST_SERVER_FAIL2:
++ case GLOBUS_GASS_TRANSFER_REQUEST_SERVER_FAIL3:
++ case GLOBUS_GASS_TRANSFER_REQUEST_USER_FAIL:
++ return GLOBUS_GASS_TRANSFER_REQUEST_FAILED;
++ case GLOBUS_GASS_TRANSFER_REQUEST_FINISHING:
++ case GLOBUS_GASS_TRANSFER_REQUEST_DONE:
++ return GLOBUS_GASS_TRANSFER_REQUEST_DONE;
++ case GLOBUS_GASS_TRANSFER_REQUEST_STARTING:
++ case GLOBUS_GASS_TRANSFER_REQUEST_STARTING2:
++ return GLOBUS_GASS_TRANSFER_REQUEST_STARTING;
++ case GLOBUS_GASS_TRANSFER_REQUEST_REFERRED:
++ case GLOBUS_GASS_TRANSFER_REQUEST_ACTING_TO_REFERRING:
++ case GLOBUS_GASS_TRANSFER_REQUEST_REFERRING:
++ return GLOBUS_GASS_TRANSFER_REQUEST_REFERRED;
++ case GLOBUS_GASS_TRANSFER_REQUEST_DENIED:
++ return GLOBUS_GASS_TRANSFER_REQUEST_DENIED;
++ case GLOBUS_GASS_TRANSFER_REQUEST_INVALID:
++ return GLOBUS_GASS_TRANSFER_REQUEST_INVALID;
++ }
+ }
+ return GLOBUS_GASS_TRANSFER_REQUEST_INVALID;
+ }
+@@ -224,45 +224,45 @@ globus_gass_transfer_request_get_status(
+ */
+ int
+ globus_gass_transfer_request_get_referral(
+- globus_gass_transfer_request_t request,
+- globus_gass_transfer_referral_t * referral)
++ globus_gass_transfer_request_t request,
++ globus_gass_transfer_referral_t * referral)
+ {
+- globus_gass_transfer_request_struct_t * req;
++ globus_gass_transfer_request_struct_t * req;
+
+ /* Sanity check of arguments */
+ if(referral == GLOBUS_NULL)
+ {
+- return GLOBUS_GASS_TRANSFER_ERROR_NULL_POINTER;
++ return GLOBUS_GASS_TRANSFER_ERROR_NULL_POINTER;
+ }
+ /* Check for illegal handle */
+ req =
+- globus_handle_table_lookup(&globus_i_gass_transfer_request_handles,
+- request);
++ globus_handle_table_lookup(&globus_i_gass_transfer_request_handles,
++ request);
+ if(req == GLOBUS_NULL)
+ {
+- return GLOBUS_GASS_TRANSFER_ERROR_INVALID_USE;
++ return GLOBUS_GASS_TRANSFER_ERROR_INVALID_USE;
+ }
+ else if(req->referral_count == 0)
+ {
+- referral->url = GLOBUS_NULL;
+- referral->count = 0;
++ referral->url = GLOBUS_NULL;
++ referral->count = 0;
+
+- return GLOBUS_SUCCESS;
++ return GLOBUS_SUCCESS;
+ }
+ else
+ {
+- globus_size_t i;
++ globus_size_t i;
+
+- referral->url =
+- globus_malloc(sizeof(char *) * req->referral_count);
++ referral->url =
++ globus_malloc(sizeof(char *) * req->referral_count);
+
+- for(i = 0; i < req->referral_count; i++)
+- {
+- referral->url[i] = globus_libc_strdup(req->referral_url[i]);
+- }
+- referral->count = req->referral_count;
++ for(i = 0; i < req->referral_count; i++)
++ {
++ referral->url[i] = globus_libc_strdup(req->referral_url[i]);
++ }
++ referral->count = req->referral_count;
+
+- return GLOBUS_SUCCESS;
++ return GLOBUS_SUCCESS;
+ }
+ }
+ /* globus_gass_transfer_request_get_referral() */
+@@ -285,20 +285,20 @@ globus_gass_transfer_request_get_referral(
+ */
+ char *
+ globus_gass_transfer_request_get_url(
+- globus_gass_transfer_request_t request)
++ globus_gass_transfer_request_t request)
+ {
+- globus_gass_transfer_request_struct_t * req;
++ globus_gass_transfer_request_struct_t * req;
+
+ req =
+- globus_handle_table_lookup(&globus_i_gass_transfer_request_handles,
+- request);
++ globus_handle_table_lookup(&globus_i_gass_transfer_request_handles,
++ request);
+ if(req == GLOBUS_NULL)
+ {
+- return GLOBUS_NULL;
++ return GLOBUS_NULL;
+ }
+ else
+ {
+- return req->url;
++ return req->url;
+ }
+ }
+ /* globus_gass_transfer_request_get_url() */
+@@ -320,20 +320,20 @@ globus_gass_transfer_request_get_url(
+ */
+ globus_size_t
+ globus_gass_transfer_request_get_length(
+- globus_gass_transfer_request_t request)
++ globus_gass_transfer_request_t request)
+ {
+- globus_gass_transfer_request_struct_t * req;
++ globus_gass_transfer_request_struct_t * req;
+
+ req =
+- globus_handle_table_lookup(&globus_i_gass_transfer_request_handles,
+- request);
++ globus_handle_table_lookup(&globus_i_gass_transfer_request_handles,
++ request);
+ if(req == GLOBUS_NULL)
+ {
+- return GLOBUS_GASS_TRANSFER_LENGTH_UNKNOWN;
++ return GLOBUS_GASS_TRANSFER_LENGTH_UNKNOWN;
+ }
+ else
+ {
+- return req->length;
++ return req->length;
+ }
+ }
+
+@@ -361,23 +361,23 @@ globus_gass_transfer_request_get_length(
+ */
+ int
+ globus_gass_transfer_request_set_type(
+- globus_gass_transfer_request_t request,
+- globus_gass_transfer_request_type_t type)
++ globus_gass_transfer_request_t request,
++ globus_gass_transfer_request_type_t type)
+ {
+- globus_gass_transfer_request_struct_t * req;
++ globus_gass_transfer_request_struct_t * req;
+
+ req =
+- globus_handle_table_lookup(&globus_i_gass_transfer_request_handles,
+- request);
++ globus_handle_table_lookup(&globus_i_gass_transfer_request_handles,
++ request);
+ if(req == GLOBUS_NULL||
+ req->type != GLOBUS_GASS_TRANSFER_REQUEST_TYPE_INVALID)
+ {
+- return GLOBUS_GASS_TRANSFER_ERROR_INVALID_USE;
++ return GLOBUS_GASS_TRANSFER_ERROR_INVALID_USE;
+ }
+ else
+ {
+- req->type = type;
+- return GLOBUS_SUCCESS;
++ req->type = type;
++ return GLOBUS_SUCCESS;
+ }
+ }
+ /* globus_gass_transfer_request_set_type() */
+@@ -410,23 +410,23 @@ globus_gass_transfer_request_set_type(
+ */
+ int
+ globus_gass_transfer_request_set_url(
+- globus_gass_transfer_request_t request,
+- char * url)
++ globus_gass_transfer_request_t request,
++ char * url)
+ {
+- globus_gass_transfer_request_struct_t * req;
++ globus_gass_transfer_request_struct_t * req;
+
+ req =
+- globus_handle_table_lookup(&globus_i_gass_transfer_request_handles,
+- request);
++ globus_handle_table_lookup(&globus_i_gass_transfer_request_handles,
++ request);
+ if(req == GLOBUS_NULL ||
+ req->url != GLOBUS_NULL)
+ {
+- return GLOBUS_GASS_TRANSFER_ERROR_INVALID_USE;
++ return GLOBUS_GASS_TRANSFER_ERROR_INVALID_USE;
+ }
+ else
+ {
+- req->url = url;
+- return GLOBUS_SUCCESS;
++ req->url = url;
++ return GLOBUS_SUCCESS;
+ }
+ }
+
+@@ -453,21 +453,21 @@ globus_gass_transfer_request_set_url(
+ */
+ void
+ globus_gass_transfer_request_set_length(
+- globus_gass_transfer_request_t request,
+- globus_size_t length)
++ globus_gass_transfer_request_t request,
++ globus_size_t length)
+ {
+- globus_gass_transfer_request_struct_t * req;
++ globus_gass_transfer_request_struct_t * req;
+
+ req =
+- globus_handle_table_lookup(&globus_i_gass_transfer_request_handles,
+- request);
++ globus_handle_table_lookup(&globus_i_gass_transfer_request_handles,
++ request);
+ if(req == GLOBUS_NULL)
+ {
+- return ;
++ return ;
+ }
+ else
+ {
+- req->length = length;
++ req->length = length;
+ }
+ }
+ /* globus_gass_transfer_request_set_length() */
+@@ -491,20 +491,20 @@ globus_gass_transfer_request_set_length(
+ */
+ int
+ globus_gass_transfer_request_get_denial_reason(
+- globus_gass_transfer_request_t request)
++ globus_gass_transfer_request_t request)
+ {
+- globus_gass_transfer_request_struct_t * req;
++ globus_gass_transfer_request_struct_t * req;
+
+ req =
+- globus_handle_table_lookup(&globus_i_gass_transfer_request_handles,
+- request);
++ globus_handle_table_lookup(&globus_i_gass_transfer_request_handles,
++ request);
+ if(req == GLOBUS_NULL)
+ {
+- return 0;
++ return 0;
+ }
+ else
+ {
+- return req->denial_reason;
++ return req->denial_reason;
+ }
+ }
+
+@@ -526,20 +526,20 @@ globus_gass_transfer_request_get_denial_reason(
+ */
+ char *
+ globus_gass_transfer_request_get_denial_message(
+- globus_gass_transfer_request_t request)
++ globus_gass_transfer_request_t request)
+ {
+- globus_gass_transfer_request_struct_t * req;
++ globus_gass_transfer_request_struct_t * req;
+
+ req =
+- globus_handle_table_lookup(&globus_i_gass_transfer_request_handles,
+- request);
++ globus_handle_table_lookup(&globus_i_gass_transfer_request_handles,
++ request);
+ if(req == GLOBUS_NULL)
+ {
+- return GLOBUS_NULL;
++ return GLOBUS_NULL;
+ }
+ else
+ {
+- return globus_libc_strdup(req->denial_message);
++ return globus_libc_strdup(req->denial_message);
+ }
+ }
+
+@@ -548,7 +548,7 @@ globus_gass_transfer_request_get_denial_message(
+ * @ingroup globus_gass_transfer_request
+ *
+ * This function queries a request handle to determine the subject
+- * identity of the client who initiated the request.
++ * identity of the client who initiated the request.
+ * The string must not be freed by the caller.
+ *
+ * @param request
+@@ -560,20 +560,20 @@ globus_gass_transfer_request_get_denial_message(
+ */
+ char *
+ globus_gass_transfer_request_get_subject(
+- globus_gass_transfer_request_t request)
++ globus_gass_transfer_request_t request)
+ {
+- globus_gass_transfer_request_struct_t * req;
++ globus_gass_transfer_request_struct_t * req;
+
+ req =
+- globus_handle_table_lookup(&globus_i_gass_transfer_request_handles,
+- request);
++ globus_handle_table_lookup(&globus_i_gass_transfer_request_handles,
++ request);
+ if(req == GLOBUS_NULL)
+ {
+- return GLOBUS_NULL;
++ return GLOBUS_NULL;
+ }
+ else
+ {
+- return req->subject;
++ return req->subject;
+ }
+ }
+ /* globus_gass_transfer_request_get_subject() */
+@@ -583,26 +583,26 @@ globus_gass_transfer_request_get_subject(
+ */
+ int
+ globus_gass_transfer_request_set_subject(
+- globus_gass_transfer_request_t request,
+- char * subject)
++ globus_gass_transfer_request_t request,
++ char * subject)
+ {
+- globus_gass_transfer_request_struct_t * req;
++ globus_gass_transfer_request_struct_t * req;
+
+ req =
+- globus_handle_table_lookup(&globus_i_gass_transfer_request_handles,
+- request);
++ globus_handle_table_lookup(&globus_i_gass_transfer_request_handles,
++ request);
+ if(req == GLOBUS_NULL)
+ {
+- return GLOBUS_GASS_TRANSFER_ERROR_INVALID_USE;
++ return GLOBUS_GASS_TRANSFER_ERROR_INVALID_USE;
+ }
+ else if(req->subject != GLOBUS_NULL)
+ {
+- return GLOBUS_GASS_TRANSFER_ERROR_INVALID_USE;
++ return GLOBUS_GASS_TRANSFER_ERROR_INVALID_USE;
+ }
+ else
+ {
+- req->subject = subject;
+- return GLOBUS_SUCCESS;
++ req->subject = subject;
++ return GLOBUS_SUCCESS;
+ }
+ }
+ /* globus_gass_transfer_request_set_subject() */
+@@ -630,19 +630,19 @@ globus_gass_transfer_request_set_subject(
+ */
+ int
+ globus_gass_transfer_request_destroy(
+- globus_gass_transfer_request_t request)
++ globus_gass_transfer_request_t request)
+ {
+- globus_gass_transfer_request_struct_t * req;
+- int rc;
++ globus_gass_transfer_request_struct_t * req;
++ int rc;
+
+ globus_i_gass_transfer_lock();
+ req =
+- globus_handle_table_lookup(&globus_i_gass_transfer_request_handles,
+- request);
++ globus_handle_table_lookup(&globus_i_gass_transfer_request_handles,
++ request);
+ if(req == GLOBUS_NULL)
+ {
+- rc = GLOBUS_GASS_TRANSFER_ERROR_INVALID_USE;
+- goto finish;
++ rc = GLOBUS_GASS_TRANSFER_ERROR_INVALID_USE;
++ goto finish;
+ }
+ if(req->status != GLOBUS_GASS_TRANSFER_REQUEST_FAILED &&
+ req->status != GLOBUS_GASS_TRANSFER_REQUEST_DONE &&
+@@ -653,8 +653,8 @@ globus_gass_transfer_request_destroy(
+ req->status != GLOBUS_GASS_TRANSFER_REQUEST_ACTING_TO_FAILING &&
+ req->status != GLOBUS_GASS_TRANSFER_REQUEST_DENIED)
+ {
+- rc = GLOBUS_GASS_TRANSFER_ERROR_INVALID_USE;
+- goto finish;
++ rc = GLOBUS_GASS_TRANSFER_ERROR_INVALID_USE;
++ goto finish;
+ }
+
+ rc = globus_i_gass_transfer_request_destroy(request);
+@@ -677,9 +677,9 @@ globus_gass_transfer_request_destroy(
+ * @note This function must be called with the request handle mutex lock.
+ *
+ * @param request
+- * The request handle to initialize. If this function is successful,
++ * The request handle to initialize. If this function is successful,
+ * the value pointed to by this will be initialized to the new
+- * handle id; otherwise, the it will be set to
++ * handle id; otherwise, the it will be set to
+ * GLOBUS_NULL_HANDLE.
+ * @param attr
+ * The request attributes to use to create the handle. If non-NULL,
+@@ -706,69 +706,69 @@ globus_i_gass_transfer_request_init(
+ globus_gass_transfer_callback_t callback,
+ void * user_arg)
+ {
+- globus_gass_transfer_request_struct_t * req;
++ globus_gass_transfer_request_struct_t * req;
+
+ req = globus_malloc(sizeof(globus_gass_transfer_request_struct_t));
+ if(req == GLOBUS_NULL)
+ {
+- goto error_exit;
++ goto error_exit;
+ }
+
+ if(url)
+ {
+- req->url = globus_libc_strdup(url);
++ req->url = globus_libc_strdup(url);
+ if(req->url == GLOBUS_NULL)
+ {
+- goto free_req;
++ goto free_req;
+ }
+ }
+ else
+ {
+- req->url = GLOBUS_NULL;
+- }
+- req->type = type;
+- req->status = GLOBUS_GASS_TRANSFER_REQUEST_STARTING;
+- req->referral_url = GLOBUS_NULL;
+- req->referral_count = 0;
+- req->callback = callback;
+- req->callback_arg = user_arg;
+- req->proto = GLOBUS_NULL;
+- req->subject = GLOBUS_NULL;
+- req->denial_reason = 0;
+- req->denial_message = GLOBUS_NULL;
+- req->handled_length = 0;
+- req->posted_length = 0;
+- req->fail_callback = GLOBUS_NULL;
+- req->client_side = GLOBUS_FALSE;
+- req->user_pointer = GLOBUS_NULL;
++ req->url = GLOBUS_NULL;
++ }
++ req->type = type;
++ req->status = GLOBUS_GASS_TRANSFER_REQUEST_STARTING;
++ req->referral_url = GLOBUS_NULL;
++ req->referral_count = 0;
++ req->callback = callback;
++ req->callback_arg = user_arg;
++ req->proto = GLOBUS_NULL;
++ req->subject = GLOBUS_NULL;
++ req->denial_reason = 0;
++ req->denial_message = GLOBUS_NULL;
++ req->handled_length = 0;
++ req->posted_length = 0;
++ req->fail_callback = GLOBUS_NULL;
++ req->client_side = GLOBUS_FALSE;
++ req->user_pointer = GLOBUS_NULL;
+
+ globus_fifo_init(&req->pending_data);
+ if(attr)
+ {
+- if(*attr)
+- {
+- req->attr = globus_object_copy(*attr);
+- if(req->attr == GLOBUS_NULL)
+- {
+- goto free_fifo;
+- }
+- }
+- else
+- {
+- req->attr = GLOBUS_NULL;
+- }
++ if(*attr)
++ {
++ req->attr = globus_object_copy(*attr);
++ if(req->attr == GLOBUS_NULL)
++ {
++ goto free_fifo;
++ }
++ }
++ else
++ {
++ req->attr = GLOBUS_NULL;
++ }
+ }
+ else
+ {
+- req->attr = GLOBUS_NULL;
++ req->attr = GLOBUS_NULL;
+ }
+
+ *request = globus_handle_table_insert(&globus_i_gass_transfer_request_handles,
+- (void *) req,
+- 2);
++ (void *) req,
++ 2);
+ globus_list_insert(&globus_i_gass_transfer_requests,
+- (void *) (intptr_t) (*request));
+-
++ (void *) (intptr_t) (*request));
++
+ return;
+
+ free_fifo:
+@@ -804,32 +804,32 @@ globus_i_gass_transfer_request_init(
+ */
+ int
+ globus_i_gass_transfer_request_destroy(
+- globus_gass_transfer_request_t request)
++ globus_gass_transfer_request_t request)
+ {
+- globus_bool_t referenced;
+- globus_gass_transfer_request_struct_t * req;
++ globus_bool_t referenced;
++ globus_gass_transfer_request_struct_t * req;
+
+ req =
+- globus_handle_table_lookup(&globus_i_gass_transfer_request_handles,
+- request);
++ globus_handle_table_lookup(&globus_i_gass_transfer_request_handles,
++ request);
+ if(req == GLOBUS_NULL)
+ {
+- return GLOBUS_GASS_TRANSFER_ERROR_INVALID_USE;
++ return GLOBUS_GASS_TRANSFER_ERROR_INVALID_USE;
+ }
+
+ referenced =
+- globus_handle_table_decrement_reference(&globus_i_gass_transfer_request_handles,
+- request);
++ globus_handle_table_decrement_reference(&globus_i_gass_transfer_request_handles,
++ request);
+ if(!referenced)
+ {
+- int i;
+- globus_list_t * tmp;
++ int i;
++ globus_list_t * tmp;
++
++ tmp = globus_list_search(globus_i_gass_transfer_requests,
++ (void *) (intptr_t) request);
+
+- tmp = globus_list_search(globus_i_gass_transfer_requests,
+- (void *) (intptr_t) request);
+-
+ #if DEBUG_GASS_TRANSFER
+- printf(_GTSL("removing from list\n"));
++ printf(_GTSL("removing from list\n"));
+ #endif
+ if (tmp)
+ {
+@@ -837,7 +837,7 @@ globus_i_gass_transfer_request_destroy(
+ tmp);
+
+ globus_cond_signal(&globus_i_gass_transfer_shutdown_cond);
+-
++
+ if(req->attr)
+ {
+ globus_object_free(req->attr);
+@@ -876,11 +876,11 @@ globus_i_gass_transfer_request_destroy(
+ request = GLOBUS_NULL_HANDLE;
+ }
+
+- return GLOBUS_SUCCESS;
++ return GLOBUS_SUCCESS;
+ }
+ else
+ {
+- return GLOBUS_SUCCESS;
++ return GLOBUS_SUCCESS;
+ }
+ }
+ /* globus_i_gass_transfer_request_destroy() */
+--
+2.54.0
+
diff --git a/0002-Fix-compiler-and-doxygen-warnings.patch b/0002-Fix-compiler-and-doxygen-warnings.patch
new file mode 100644
index 0000000..ec707af
--- /dev/null
+++ b/0002-Fix-compiler-and-doxygen-warnings.patch
@@ -0,0 +1,132 @@
+From 4ee08d13e2963309e2063dc45dedd067337d3b76 Mon Sep 17 00:00:00 2001
+From: Mattias Ellert <mattias.ellert@physics.uu.se>
+Date: Wed, 20 May 2026 00:15:37 +0200
+Subject: [PATCH 2/2] Fix compiler and doxygen warnings
+
+---
+ gass/transfer/source/library/globus_gass_transfer.c | 3 +--
+ gass/transfer/source/library/globus_gass_transfer.h | 10 +++++-----
+ .../source/library/globus_gass_transfer_http.c | 4 +---
+ .../source/library/globus_gass_transfer_request.c | 7 +------
+ 4 files changed, 8 insertions(+), 16 deletions(-)
+
+diff --git a/gass/transfer/source/library/globus_gass_transfer.c b/gass/transfer/source/library/globus_gass_transfer.c
+index 1bc3b27f2..92809209e 100644
+--- a/gass/transfer/source/library/globus_gass_transfer.c
++++ b/gass/transfer/source/library/globus_gass_transfer.c
+@@ -161,7 +161,6 @@ globus_l_gass_transfer_deactivate(void)
+ {
+ globus_gass_transfer_listener_t tmp;
+ globus_gass_transfer_listener_struct_t *l;
+- int rc;
+
+ tmp = (globus_gass_transfer_listener_t) (intptr_t)
+ globus_list_first(rest);
+@@ -172,7 +171,7 @@ globus_l_gass_transfer_deactivate(void)
+ &globus_i_gass_transfer_listener_handles,
+ tmp);
+
+- rc = globus_i_gass_transfer_close_listener(
++ globus_i_gass_transfer_close_listener(
+ tmp,
+ l,
+ globus_l_gass_transfer_listener_close_callback,
+diff --git a/gass/transfer/source/library/globus_gass_transfer.h b/gass/transfer/source/library/globus_gass_transfer.h
+index 650fb402c..617df87e2 100644
+--- a/gass/transfer/source/library/globus_gass_transfer.h
++++ b/gass/transfer/source/library/globus_gass_transfer.h
+@@ -252,7 +252,7 @@ typedef enum
+
+ /**
+ * GASS error codes
+- * @ingroup globus_gass_constants
++ * @ingroup globus_gass_transfer
+ */
+ enum
+ {
+@@ -293,7 +293,7 @@ enum
+ };
+
+ /**
+- * @ingroup globus_gass_constants
++ * @ingroup globus_gass_transfer
+ *
+ * Default buffer length for the globus_gass_transfer_assist library.
+ *
+@@ -305,7 +305,7 @@ enum
+ };
+
+ /**
+- * @ingroup globus_gass_constants
++ * @ingroup globus_gass_transfer
+ *
+ * Value for files we don't know the length of.
+ *
+@@ -314,7 +314,7 @@ enum
+ #define GLOBUS_GASS_TRANSFER_LENGTH_UNKNOWN 0UL
+
+ /**
+- * @ingroup globus_gass_constants
++ * @ingroup globus_gass_transfer
+ *
+ * Value for timestamps we don't know the value of.
+ *
+@@ -504,7 +504,7 @@ globus_gass_transfer_listener_set_user_pointer(
+
+ /**
+ * @defgroup globus_gass_transfer_data Sending and Receiving Data
+- * @ingroup globus_gass_tansfer
++ * @ingroup globus_gass_transfer
+ * @brief Sending and Receiving Data
+ */
+
+diff --git a/gass/transfer/source/library/globus_gass_transfer_http.c b/gass/transfer/source/library/globus_gass_transfer_http.c
+index c7d989c5f..926e48504 100644
+--- a/gass/transfer/source/library/globus_gass_transfer_http.c
++++ b/gass/transfer/source/library/globus_gass_transfer_http.c
+@@ -1660,7 +1660,6 @@ globus_l_gass_transfer_http_request_refer(
+ {
+ globus_gass_transfer_http_request_proto_t * proto;
+ globus_gass_transfer_referral_t referral;
+- int rc;
+ char * referral_string;
+ globus_size_t referral_count;
+ globus_size_t body_count=0; /* :) */
+@@ -1673,8 +1672,7 @@ globus_l_gass_transfer_http_request_refer(
+ globus_l_gass_transfer_http_lock();
+ proto = (globus_gass_transfer_http_request_proto_t *) rproto;
+
+- rc = globus_gass_transfer_request_get_referral(request,
+- &referral);
++ globus_gass_transfer_request_get_referral(request, &referral);
+
+ /* HTTP/1.1 302 Document Moved CRLF
+ * Location: referral.url[0] CRLF
+diff --git a/gass/transfer/source/library/globus_gass_transfer_request.c b/gass/transfer/source/library/globus_gass_transfer_request.c
+index eb21fbb98..5a7010b0d 100644
+--- a/gass/transfer/source/library/globus_gass_transfer_request.c
++++ b/gass/transfer/source/library/globus_gass_transfer_request.c
+@@ -445,11 +445,6 @@ globus_gass_transfer_request_set_url(
+ * A handle to the request to modify.
+ * @param length
+ * The length of the file request.
+- *
+- * @retval GLOBUS_SUCCESS
+- * The URL was set for the request handle.
+- * @retval GLOBUS_GASS_TRANSFER_ERROR_INVALID_USE
+- * The request handle was invalid, or the URL had already been set.
+ */
+ void
+ globus_gass_transfer_request_set_length(
+@@ -463,7 +458,7 @@ globus_gass_transfer_request_set_length(
+ request);
+ if(req == GLOBUS_NULL)
+ {
+- return ;
++ return;
+ }
+ else
+ {
+--
+2.54.0
+
diff --git a/globus-gass-transfer.spec b/globus-gass-transfer.spec
index 025d953..c816639 100644
--- a/globus-gass-transfer.spec
+++ b/globus-gass-transfer.spec
@@ -1,13 +1,15 @@
Name: globus-gass-transfer
%global _name %(tr - _ <<< %{name})
Version: 9.5
-Release: 2%{?dist}
+Release: 3%{?dist}
Summary: Grid Community Toolkit - Globus Gass Transfer
License: Apache-2.0
URL: https://github.com/gridcf/gct/
Source: https://repo.gridcf.org/gct6/sources/%{_name}-%{version}.tar.gz
Source8: README
+Patch0: 0001-Untabify-and-remove-trailing-white-space.patch
+Patch1: 0002-Fix-compiler-and-doxygen-warnings.patch
BuildRequires: make
BuildRequires: gcc
@@ -57,6 +59,8 @@ Globus Gass Transfer Documentation Files
%prep
%setup -q -n %{_name}-%{version}
+%patch -P0 -p4
+%patch -P1 -p4
%build
# Reduce overlinking
@@ -105,6 +109,9 @@ rm %{buildroot}%{_pkgdocdir}/GLOBUS_LICENSE
%license GLOBUS_LICENSE
%changelog
+* Sun Jun 14 2026 Mattias Ellert <mattias.ellert@physics.uu.se> - 9.5-3
+- Fix compiler and doxygen warnings
+
* Fri Jan 16 2026 Fedora Release Engineering <releng@fedoraproject.org> - 9.5-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_44_Mass_Rebuild
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-06-14 8:46 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-06-14 8:46 [rpms/globus-gass-transfer] rawhide: Fix compiler and doxygen warnings Mattias Ellert
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox