ps3dev / PSL1GHT

A lightweight PS3 SDK
www.psl1ght.com
MIT License
222 stars 62 forks source link

libHttp changes #97

Closed bucanero closed 4 years ago

bucanero commented 4 years ago

As mentioned in #89 , current libhttp methods don't work properly.

This is a proposed patch, tested and working on real ps3 hardware.

dee12452 commented 4 years ago

If the ps3 VSH exports list says these use size_t, would it be better to use u32 instead of s32? I feel like any time a param has the word "size" in it, it's not usually a negative value.

miigotu commented 4 years ago

@dee12452 correct, most of these are all ppolsize, maxsize, etc which would all be positive integers. @bucanero can you try switching them to u32? s32 probably doesnt make a difference but u32 would be the proper cast.

Edit: actually uint32_t

bucanero commented 4 years ago

yes, I agree, it seems better to use unsigned uint32_t for all the size_t parameters. I'll change it and test again.

btw, any preference between u32 and uint32_t in PSL1GHT? I guess I've seen both used so not sure which one is the preferred one.

dee12452 commented 4 years ago

From looking through the code, it looked to me like u32 was being used more often edit: thought you wrote performance, not preference... lol

miigotu commented 4 years ago

I personally would go with whatever convention is used in each file. That's why I said uint32_t in this case because those files seem to use that stdint types the most.

bucanero commented 4 years ago

I personally would go with whatever convention is used in each file. That's why I said uint32_t in this case because those files seem to use that stdint types the most.

I tested again the http/https methods using u32 and everything works ok. 👍

I followed @miigotu criteria, and used u32 in files where they are using s32 already, and used uint32_t in ssl.h where they're using the uintX_t style.