[PATCH] show entire list of networks in wpagui

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>From 96552aaedb7faf4d432f366f3933447efb9e6ad4 Mon Sep 17 00:00:00 2001
From: Victor Ananyev <vindex10@xxxxxxxxx>
Date: Thu, 19 Sep 2019 00:12:23 +0200
Subject: [PATCH] show entire list of networks in wpagui

exploit LAST_ID of LIST_NETWORKS to load all of them iteratively

Signed-off-by: Victor Ananyev <vindex10@xxxxxxxxx>
---
 wpa_supplicant/wpa_gui-qt4/wpagui.cpp | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/wpa_supplicant/wpa_gui-qt4/wpagui.cpp
b/wpa_supplicant/wpa_gui-qt4/wpagui.cpp
index a0aa05ed3..b6bd3e1da 100644
--- a/wpa_supplicant/wpa_gui-qt4/wpagui.cpp
+++ b/wpa_supplicant/wpa_gui-qt4/wpagui.cpp
@@ -12,6 +12,8 @@

 #include <cstdio>
 #include <unistd.h>
+#include <chrono>
+#include <thread>
 #include <QMessageBox>
 #include <QCloseEvent>
 #include <QImageReader>
@@ -715,7 +717,22 @@ void WpaGui::updateNetworks()

  if (last)
  break;
+
  start = end + 1;
+ if (*start)
+ continue;
+
+ std::this_thread::sleep_for(std::chrono::milliseconds(200));  //
avoid race conditions
+ QString cmd("LIST_NETWORKS LAST_ID=");
+ cmd.append(id);
+ if (ctrlRequest(cmd.toLocal8Bit().constData(), buf, &len) < 0)
+ break;
+
+ buf[len] = '\0';
+ start = strchr(buf, '\n');
+ if (start == NULL)
+ break;
+ start++;
  }

  if (networkSelect->count() > 1)
-- 
2.21.0
From 96552aaedb7faf4d432f366f3933447efb9e6ad4 Mon Sep 17 00:00:00 2001
From: Victor Ananyev <vindex10@xxxxxxxxx>
Date: Thu, 19 Sep 2019 00:12:23 +0200
Subject: [PATCH] show entire list of networks in wpagui

explot LAST_ID of LIST_NETWORKS to load all of them iteratively

Signed-off-by: Victor Ananyev <vindex10@xxxxxxxxx>
---
 wpa_supplicant/wpa_gui-qt4/wpagui.cpp | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/wpa_supplicant/wpa_gui-qt4/wpagui.cpp b/wpa_supplicant/wpa_gui-qt4/wpagui.cpp
index a0aa05ed3..b6bd3e1da 100644
--- a/wpa_supplicant/wpa_gui-qt4/wpagui.cpp
+++ b/wpa_supplicant/wpa_gui-qt4/wpagui.cpp
@@ -12,6 +12,8 @@
 
 #include <cstdio>
 #include <unistd.h>
+#include <chrono>
+#include <thread>
 #include <QMessageBox>
 #include <QCloseEvent>
 #include <QImageReader>
@@ -715,7 +717,22 @@ void WpaGui::updateNetworks()
 
 		if (last)
 			break;
+
 		start = end + 1;
+		if (*start)
+			continue;
+
+		std::this_thread::sleep_for(std::chrono::milliseconds(200));  // avoid race conditions
+		QString cmd("LIST_NETWORKS LAST_ID=");
+		cmd.append(id);
+		if (ctrlRequest(cmd.toLocal8Bit().constData(), buf, &len) < 0)
+			break;
+
+		buf[len] = '\0';
+		start = strchr(buf, '\n');
+		if (start == NULL)
+			break;
+		start++;
 	}
 
 	if (networkSelect->count() > 1)
-- 
2.21.0

_______________________________________________
Hostap mailing list
Hostap@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/hostap

[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux