Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
O
octopi
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Test Cases
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Packages
Community
octopi
Commits
05a2bbd7
Commit
05a2bbd7
authored
Jul 07, 2018
by
Philip Müller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[patch] add missing patch
parent
f0c5af5b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
55 additions
and
0 deletions
+55
-0
revert-3935abc.patch
revert-3935abc.patch
+55
-0
No files found.
revert-3935abc.patch
0 → 100644
View file @
05a2bbd7
From 3935abcd821650620828c44b424398ac363847a7 Mon Sep 17 00:00:00 2001
From: Alexandre Arnt <falso@correio.com>
Date: Wed, 6 Jun 2018 17:03:14 -0300
Subject: [PATCH] - BugFix: Another way to test network connectivity.
---
src/unixcommand.cpp | 21 +++++++++++++++++++--
1 file changed, 19 insertions(+), 2 deletions(-)
diff --git a/src/unixcommand.cpp b/src/unixcommand.cpp
index 191b818..788c139 100644
--- a/src/unixcommand.cpp
+++ b/src/unixcommand.cpp
@@ -30,7 +30,7 @@
#include <QFileInfo>
#include <QByteArray>
#include <QTextStream>
-#include <QtNetwork/QNetworkInterface>
+#include <QtNetwork>
/*
* Collection of methods to execute many Unix commands
@@ -608,7 +608,23 @@
bool UnixCommand::hasInternetConnection()
*/
bool UnixCommand::doInternetPingTest()
{
- QProcess ping;
+ QTcpSocket socket;
+ QString hostname = "www.google.com";
+
+ socket.connectToHost(hostname, 80);
+ if (socket.waitForConnected(5000))
+ return true;
+ else
+ {
+ hostname = "www.baidu.com";
+ socket.connectToHost(hostname, 80);
+ if (socket.waitForConnected(5000))
+ return true;
+ else
+ return false;
+ }
+
+/* QProcess ping;
int res;
QProcessEnvironment env = QProcessEnvironment::systemEnvironment();
env.insert("LANG", "C");
@@ -638,6 +654,7 @@
bool UnixCommand::doInternetPingTest()
ping.close();
return (res == 0); //ZERO code means ping was alive!
+*/
}
/*
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment