-static void length_completed(void *v, long l) {
- struct callbackdata *cbd = v;
- long *value;
-
- D(("namepart_completed"));
- value = xmalloc(sizeof *value);
- *value = l;
- cache_put(&cachetype_integer, cbd->u.key, value);
- ++namepart_completions_deferred;
- namepart_completed_or_failed();
-}
-
-/** @brief Called when a length or namepart lookup has failed */
-static void namepart_protocol_error(
- struct callbackdata attribute((unused)) *cbd,
- int attribute((unused)) code,
- const char *msg) {
- D(("namepart_protocol_error"));
- gtk_label_set_text(GTK_LABEL(report_label), msg);
+static void length_completed(void *v, const char *error, long l) {
+ if(error)
+ gtk_label_set_text(GTK_LABEL(report_label), error);
+ else {
+ const char *key = v;
+ long *value;
+
+ D(("namepart_completed"));
+ value = xmalloc(sizeof *value);
+ *value = l;
+ cache_put(&cachetype_integer, key, value);
+ ++namepart_completions_deferred;
+ }