Revision cce97007

View differences:

mainbox/query.c
37 37
  CURLcode error_code;
38 38
  char url[1024];
39 39
  int result = 0;
40
  long response = 0;
40 41

  
41 42
  handle = curl_easy_init();
42 43
  if (handle == NULL)
......
55 56
  error_code = curl_easy_perform(handle);
56 57
  if (error_code) goto error;
57 58

  
59
  error_code = curl_easy_getinfo(handle, CURLINFO_RESPONSE_CODE, &response);
60
  if (error_code) goto error;
61
  if (response >= 400)
62
    fprintf(stderr, "Error %ld from %s\n", response, url);
63
  else if (response > 200)
64
    fprintf(stderr, "Warning: response %ld from %s\n", response, url);
65

  
58 66
  curl_easy_cleanup(handle);
59 67
  return result;
60 68

  
mainbox/tool.c
4 4
#include <modbus.h>
5 5
#include <stdio.h>
6 6
#include <errno.h>
7
#include <stdlib.h> // TODO temporary
8 7

  
9 8
modbus_t *ctx;
10 9

  

Also available in: Unified diff