@@ -414,10 +414,16 @@ static void gh__response_status__set_from_slot(
414
414
strbuf_addf (& status -> error_message , "%s (curl)" ,
415
415
curl_easy_strerror (status -> curl_code ));
416
416
status -> ec = GH__ERROR_CODE__CURL_ERROR ;
417
+
418
+ trace2_data_string ("gvfs-helper" , NULL ,
419
+ "error/curl" , status -> error_message .buf );
417
420
} else {
418
421
strbuf_addf (& status -> error_message , "HTTP %ld Unexpected" ,
419
422
status -> response_code );
420
423
status -> ec = GH__ERROR_CODE__HTTP_UNEXPECTED_CODE ;
424
+
425
+ trace2_data_string ("gvfs-helper" , NULL ,
426
+ "error/http" , status -> error_message .buf );
421
427
}
422
428
423
429
if (status -> ec != GH__ERROR_CODE__OK )
@@ -2054,7 +2060,7 @@ static enum gh__error_code do_sub_cmd__get(int argc, const char **argv)
2054
2060
}
2055
2061
2056
2062
/*
2057
- * Handle the 'get' command when in "server mode". Only call error()
2063
+ * Handle the 'get' command when in "server mode". Only call error() and set ec
2058
2064
* for hard errors where we cannot communicate correctly with the foreground
2059
2065
* client process. Pass any actual data errors (such as 404's or 401's from
2060
2066
* the fetch back to the client process.
@@ -2126,10 +2132,15 @@ static enum gh__error_code do_server_subprocess_get(void)
2126
2132
goto cleanup ;
2127
2133
}
2128
2134
2135
+ /*
2136
+ * We only use status.ec to tell the client whether the request
2137
+ * was complete, incomplete, or had IO errors. We DO NOT return
2138
+ * this value to our caller.
2139
+ */
2129
2140
err = 0 ;
2130
- if (ec == GH__ERROR_CODE__OK )
2141
+ if (status . ec == GH__ERROR_CODE__OK )
2131
2142
err = packet_write_fmt_gently (1 , "ok\n" );
2132
- else if (ec == GH__ERROR_CODE__HTTP_404 )
2143
+ else if (status . ec == GH__ERROR_CODE__HTTP_404 )
2133
2144
err = packet_write_fmt_gently (1 , "partial\n" );
2134
2145
else
2135
2146
err = packet_write_fmt_gently (1 , "error %s\n" ,
@@ -2357,6 +2368,7 @@ int cmd_main(int argc, const char **argv)
2357
2368
usage_with_options (main_usage , main_options );
2358
2369
2359
2370
trace2_cmd_name ("gvfs-helper" );
2371
+ packet_trace_identity ("gvfs-helper" );
2360
2372
2361
2373
setup_git_directory_gently (NULL );
2362
2374
0 commit comments