Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RPC broken on Windows #202

Closed
dooglus opened this issue Jul 16, 2015 · 8 comments
Closed

RPC broken on Windows #202

dooglus opened this issue Jul 16, 2015 · 8 comments

Comments

@dooglus
Copy link
Collaborator

dooglus commented Jul 16, 2015

See https://bitcointalk.org/index.php?topic=623147.msg11897391#msg11897391

Apparently the content-type header is having a 'u' appended.

@dooglus
Copy link
Collaborator Author

dooglus commented Jul 16, 2015

util.h defines the formats:

/* Format characters for (s)size_t and ptrdiff_t */
#if defined(_MSC_VER) || defined(__MSVCRT__)
  /* (s)size_t and ptrdiff_t have the same size specifier in MSVC:
     http://msdn.microsoft.com/en-us/library/tcxf1dw6%28v=vs.100%29.aspx
   */
  #define PRIszx    "Ix"
  #define PRIszu    "Iu"
  #define PRIszd    "Id"
  #define PRIpdx    "Ix"
  #define PRIpdu    "Iu"
  #define PRIpdd    "Id"
#else /* C99 standard */
  #define PRIszx    "zx"
  #define PRIszu    "zu"
  #define PRIszd    "zd"
  #define PRIpdx    "tx"
  #define PRIpdu    "tu"
  #define PRIpdd    "td"
#endif

So that's where the problem should be fixed?

@l0rdicon
Copy link
Collaborator

Your suggestion on the form of changing

bitcoin/src/rpcprotocol.cpp to:

        "Content-Length: %u\r\n"

was what I ended on as well. I think thats the way to go.

@creativecuriosity
Copy link
Collaborator

The Blackcoin commit for reference:

c974b21

@dooglus
Copy link
Collaborator Author

dooglus commented Jul 16, 2015

The blackcoin commit replaces PRIszu with u throughout? Wouldn't it be better to fix just the #define line if it's wrong?

I tried getting set up with gitian but am getting errors all over the place so I've so far been unable to experiment with the Windows compiler.

@ghost
Copy link

ghost commented Jul 16, 2015

I encountered this in another altcoin (can't recall which, wasn't CLAMS tho'). Was under Linux (ubuntu 14.04) and bracketing the PRIszu with whitespace worked for me, as per the SO question on using symbols in a string referenced by dooglus in the bct thread.

See if this works:

"Content-Length: %" PRIszu "\r\n"

Cheers

Graham

@dooglus
Copy link
Collaborator Author

dooglus commented Jul 25, 2015

Fixed by #206 in release v1.4.15.

@dooglus dooglus closed this as completed Jul 25, 2015
@dooglus
Copy link
Collaborator Author

dooglus commented Jul 25, 2015

@gjhiggins We tried adding spaces as you suggested, but it had no effect. It turned out the problem was that we were using gitian to cross-compile for Windows, which uses MinGW, which is a GNU c++ compiler and so doesn't know the non-ANSI Microsoft format codes.

See #205 for details of my testing and #206 for the resolution.

@casinobitcoin
Copy link

Cheers Guys!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants