2
0

13 Commits

Author SHA1 Message Date
Sergio Padrino
7eabea0f1a Bump version to 0.9.4 2021-03-11 17:50:43 +01:00
Sergio Padrino
82635217c5 Merge pull request #5 from desktop/improve-windows-error-logs 2021-03-11 08:48:56 -08:00
Sergio Padrino
0ff24f8744 Improve error message when the trampoline can't connect to the server 2021-03-11 17:36:00 +01:00
Sergio Padrino
dd13c4b6cc Fix getting WSA error description on Windows 2021-03-11 04:04:25 -08:00
Sergio Padrino
639ed9be89 Show WSA error description on initialization too 2021-03-04 11:08:58 +01:00
Sergio Padrino
ff581e8b44 Get description for Winsock errors 2021-03-04 10:52:04 +01:00
Sergio Padrino
1a8de46fb7 Merge pull request #3 from desktop/releases/0.9.3 2021-02-18 01:15:47 -08:00
Sergio Padrino
ad699b35c0 Update releases.md 2021-02-18 10:08:32 +01:00
Sergio Padrino
31bc7170f6 Bump version to 0.9.3 2021-02-18 10:07:10 +01:00
Sergio Padrino
9cc5d4f9ee Document the release process 2021-02-18 10:07:02 +01:00
Sergio Padrino
731c53d97f Merge pull request #2 from philipturnbull/buffer-off-by-one
Reserve space for the NUL terminator
2021-02-18 00:07:25 -08:00
Phil Turnbull
6669833e3d Reserve space for the NUL terminator
If we read exactly `BUFFER_LENGTH` characters then we will overflow the buffer
when writing the NUL terminator. We need to reserve one extra character for the
NUL terminator.
2021-02-17 18:09:31 -05:00
Sergio Padrino
ca8d10fddb Merge pull request #1 from desktop/releases/0.9.2 2021-02-17 02:50:24 -08:00
4 changed files with 53 additions and 7 deletions

25
docs/releases.md Normal file
View File

@@ -0,0 +1,25 @@
# Releases
All releases are published using GitHub releases. Anyone with push access to the
repository can create a new release.
### Release Process
1. Create a branch named `releases/X.Y.Z`, where `X.Y.Z` is the version you want
to release.
1. Update the `version` field in the `package.json` with the new version you're
about to release.
1. Open a Pull Request for that branch.
1. Once the branch is approved, `git tag vX.Y.Z` the version you wish to
publish. **Important:** the version in the tag name must be preceeded by a
`v`.
1. `git push --follow-tags` to ensure all new commits (and the tag) are pushed
to the remote. Pushing the tag will start the release process.
1. Wait a few minutes for the build to finish (look for the build in
https://github.com/desktop/desktop-trampoline/actions)
1. Once the build is complete it will create a new release with all of the
assets and suggested release notes.
1. Update the changelog to whatever makes sense for this release. It should be
focused on user-facing changes.
1. Confirm all assets are uploaded for all the supported platforms.
1. Merge the Pull Request into `main` and you're done :tada:

View File

@@ -1,6 +1,6 @@
{
"name": "desktop-trampoline",
"version": "0.9.2",
"version": "0.9.4",
"main": "index.js",
"keywords": [],
"author": "",

View File

@@ -66,7 +66,9 @@ int runTrampolineClient(SOCKET *outSocket, int argc, char **argv, char **envp) {
*outSocket = socket;
if (connectSocket(socket, desktopPort) != 0) {
printSocketError("ERROR: Couldn't connect to 127.0.0.1:%d", desktopPort);
printSocketError("ERROR: Couldn't connect to 127.0.0.1:%d - Please make "
"sure you don't have an antivirus or firewall blocking "
"this connection.", desktopPort);
return 1;
}
@@ -102,7 +104,7 @@ int runTrampolineClient(SOCKET *outSocket, int argc, char **argv, char **envp) {
// TODO: send stdin stuff?
char buffer[BUFFER_LENGTH];
char buffer[BUFFER_LENGTH + 1];
size_t totalBytesRead = 0;
ssize_t bytesRead = 0;

View File

@@ -6,13 +6,30 @@
#include <stdlib.h>
#include <string.h>
#ifdef WINDOWS
#define MAX_WSA_ERROR_DESCRIPTION_LENGTH 4096
void getWSALastErrorDescription(wchar_t *buffer, int bufferLength) {
FormatMessageW(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
NULL, WSAGetLastError(),
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
(LPWSTR)buffer, bufferLength - 1, NULL);
}
#endif
int initializeNetwork(void) {
#ifdef WINDOWS
// Initialize Winsock
WSADATA wsaData;
int result = WSAStartup(MAKEWORD(2,2), &wsaData);
if (result != NO_ERROR) {
fprintf(stderr, "ERROR: WSAStartup failed: %d\n", result);
wchar_t errorDescription[MAX_WSA_ERROR_DESCRIPTION_LENGTH];
getWSALastErrorDescription(errorDescription, MAX_WSA_ERROR_DESCRIPTION_LENGTH);
fprintf(stderr, "ERROR: WSAStartup failed (%d). Error %ld: %ls\n",
result, WSAGetLastError(), errorDescription);
return 1;
}
#endif
@@ -55,8 +72,7 @@ int readSocket(SOCKET socket, void *buffer, size_t length) {
return recv(socket, buffer, length, 0);
}
void printSocketError(char *fmt, ...)
{
void printSocketError(char *fmt, ...) {
char formatted_string[4096];
va_list argptr;
@@ -65,7 +81,10 @@ void printSocketError(char *fmt, ...)
va_end(argptr);
#ifdef WINDOWS
fprintf(stderr, "%s: %ld\n", formatted_string, WSAGetLastError());
wchar_t errorDescription[MAX_WSA_ERROR_DESCRIPTION_LENGTH];
getWSALastErrorDescription(errorDescription, MAX_WSA_ERROR_DESCRIPTION_LENGTH);
fprintf(stderr, "%s (%ld): %ls\n", formatted_string, WSAGetLastError(), errorDescription);
#else
fprintf(stderr, "%s (%d): %s\n", formatted_string, errno, strerror(errno));
#endif