Results 1 to 7 of 7

Thread: http trouble again, segfaults when no internet

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    N.B. Canada
    Posts
    47
    Thanked 8 Times in 7 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default http trouble again, segfaults when no internet

    Hello, hopefully someone can help me out, and show me where I am making a mistake. I have attached a simple application that I am using to test two classes, Image and Document. Although in this example, it isn't totally representative of how classes are used, the http part and functionality is very much similar to how it is in real code. As well the API is somewhat similar to the real code, ie. Its one-time use classes that delete themselves upon finishing the job. The Image class is used to download an image from a web server. Document is used to get a html or xml, or any other type of document from a web server. You supply a url in the line edit, and press 1 of the two buttons. Get Image button gets the image, and then displays it in the top. Get Document button gets the document and puts it in the text edit in the bottom. The 2 http functionalities in the 2 classes are almost identical. The test works fine, except that it crashes when there is no internet connection. For example if I phisically remove the cable from my cable modem, and try to run this, it crashes. I am not sure exactly where the problem is. backtrace doesn't seem to provide much useful info, at least not to me. And I am not sure what else to try. Any ideas are welcome.

    Bojan
    Attached Files Attached Files
    The march of progress:
    C:
    printf("%10.2f", x);
    C++:
    cout << setw(10) << setprecision(2) << showpoint << x;
    Java:
    java.text.NumberFormat formatter = java.text.NumberFormat.getNumberInstance();
    formatter.setMinimumFractionDigits(2);
    formatter.setMaximumFractionDigits(2);
    String s = formatter.format(x);
    for (int i = s.length(); i < 10; i++) System.out.print(' ');
    System.out.print(s);

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.