httpcGetResponseStatusCode returns -660561880

Discussion in '3DS - Homebrew Development and Emulators' started by moriczgergo, Dec 30, 2016.

  1. moriczgergo
    OP

    moriczgergo GBAtemp Regular

    Member
    112
    76
    Dec 28, 2016
    Hungary
    Between table and chair, chugging water.
    So I'm trying to make a remote control for my httpc testing on the 3DS, which lets me specify the URL it should load and print. I use a .txt file on my webserver that I can edit anytime. My problem is that when I try to "download" the contents of the specified url, httpcGetResponseStatusCode strangely returns -660561880.

    I really think that I messed up somewhere, I'm not sure how to use one context twice.
    NOTE: If I remove httpcGetResponseStatusCode, then httpcBeginRequest fails.

    Code: http://pastebin.com/h5QKsR9P

    Thanks!
     
  2. erman1337

    erman1337 GBAtemp Maniac

    Member
    1,211
    927
    Sep 27, 2015
    Belgium
    Brussels
  3. MaK11-12

    MaK11-12 GBAtemp Regular

    Member
    229
    115
    Jul 26, 2009
    Namek
    "Result" is s32. So instead of casting ret as an int, use "%ld" instead of "%d" inside the printf. So:
    printf("http_download->httpcGetResponseStatusCode returned %ld\n", ret);​

    I doubt this solves your issue though.
     
  4. moriczgergo
    OP

    moriczgergo GBAtemp Regular

    Member
    112
    76
    Dec 28, 2016
    Hungary
    Between table and chair, chugging water.
    Solved it.

    The problem was that there was a \n on the end of buf.