Search:

Type: Posts; User: tpe

Search: Search took 0.01 seconds.

  1. Thread: Autoconf help

    by tpe
    Replies
    6
    Views
    2,321

    The problem is not the macro, because the mysql.h...

    The problem is not the macro, because the mysql.h is part of the configure.ac. Specifically, I added the AC_CHECK_HEADER(mysql.h).
    It correctly reports that mysql.h is missing, but ./configure...
  2. Thread: Autoconf help

    by tpe
    Replies
    6
    Views
    2,321

    OK, I found it. I added the AX_LIB_MYSQL()...

    OK, I found it. I added the AX_LIB_MYSQL() statement just before the libs.
    Now, since I want to test the functionality:
    I have installed on my pc the mysqlclient lib but not the mysql.h file.
    So,...
  3. Thread: Autoconf help

    by tpe
    Replies
    6
    Views
    2,321

    First of all, I really thank you for your answer....

    First of all, I really thank you for your answer.
    Now, I tried to just use the macro and not modifying the configure.ac script.
    So, I deleted all config* files from the project home directory,...
  4. Thread: Autoconf help

    by tpe
    Replies
    6
    Views
    2,321

    Autoconf help

    Hallo,
    I need you help with auitoconf. I have a project with existing source. I need to convert that program and include support for mysql.
    Since I want to do it with the "right" way, I...
  5. Thread: Help with sockets

    by tpe
    Replies
    2
    Views
    872

    open_stream (const char *host, unsigned int ...

    open_stream (const char *host, unsigned int port)
    {
    struct addrinfo *res, *addr, hints;
    static char service[6];
    int sock, ret;

    sprintf (service, "%hu", port);

    memset...
  6. Thread: Help with sockets

    by tpe
    Replies
    2
    Views
    872

    Help with sockets

    Hi,
    I need to open a non standard TCP (high) port though a proxy server in order to connect via company's proxy server to another server. The proxy is Squid, but allows traffic to the specific port...
  7. Replies
    24
    Views
    3,713

    OK, clear. But why is it working? I mean, when I...

    OK, clear. But why is it working? I mean, when I use "=" I have no segmentation faults. With everything else (malloc, strdup, etc), I get some nice segmentation faults that are not very helpful......
  8. Replies
    24
    Views
    3,713

    Why? getenv returns char*, as my variable is....

    Why?
    getenv returns char*, as my variable is. So, effectively, when I write:


    char *a, *b;
    a=b;

    all I am instructing the program to do is:
    copy everything from the pointer a to pointer b....
  9. Replies
    16
    Views
    9,710

    Yes, I got your point. The correct code would be:...

    Yes, I got your point. The correct code would be:


    sscanf(srv, "http://%[^:]:%5u", pHost, &prxPort);


    ..but only for positive numbers. I have to figure out how to get only a positive number...
  10. Replies
    24
    Views
    3,713

    My thought was about the strlen. However, is...

    My thought was about the strlen. However, is stlen overflow safe?
    What do you mean by strdup()/free()?
    If you mean the "MAX_ENVSTR 256", I do not consider it as efficient way of programming. In...
  11. Replies
    24
    Views
    3,713

    Hmmm. Yeap, I got yout point. a printf("%d",...

    Hmmm.
    Yeap, I got yout point. a printf("%d", sizeof getenv...) return 5, so, it's wrong. Should I use the following, then?


    envProxySrv=malloc(sizeof...
  12. Replies
    24
    Views
    3,713

    what is malloc doing?

    Hallo,
    I have the problem with the parsing of the http_proxy variable (see thread:)
    Now, in order to follow some best practices (at least that is what I have read), I need to use malloc before the...
  13. Replies
    16
    Views
    9,710

    Numeric overflow?

    Numeric overflow?
  14. Replies
    16
    Views
    9,710

    I know. That's my problem, the sscaf

    I know. That's my problem, the sscaf
  15. Replies
    16
    Views
    9,710

    envProxySrv=getenv("http_proxy");

    envProxySrv=getenv("http_proxy");
  16. Replies
    16
    Views
    9,710

    Yes, that would be an option. But in that case, I...

    Yes, that would be an option. But in that case, I should assume that the maximum length could be only 255 characters. OK, I know RFC etc, but since we are talking about user input, I would like to...
  17. Replies
    16
    Views
    9,710

    I am not sure that I understand your second...

    I am not sure that I understand your second question...
    About the global variable, the issue is that I don't like from the designs point of view, to mess up with the rest of the code. In reallity,...
  18. Replies
    16
    Views
    9,710

    Guys, thank you for your answer. I was suspecting...

    Guys, thank you for your answer. I was suspecting that. But, I am out of C programming for years and PHP or other scripting language are very easy on that matter.
    So, the issue was indeed the sizes....
  19. Replies
    16
    Views
    9,710

    Simple URL spliter and sscanf questions

    Dear all,
    I need to parse the http_proxy environmental variable in a linux C program.
    Of course I do know how to retrieve the variable, but I am not sure that I correctly split the variable into...
  20. Replies
    6
    Views
    12,470

    OK, I will open a new thread then :)

    OK, I will open a new thread then :)
  21. Replies
    6
    Views
    12,470

    OK, I know that this is a very late "answer", but...

    OK, I know that this is a very late "answer", but in my case it is not working.
    I have the following data:


    char *srv;
    char *prxHostname;

    srv=getenv("http_proxy");
    sscanf(strcat(srv, "/"),...
Results 1 to 21 of 21